1 // **********************************************************************
3 // Copyright (c) 2003-2011 ZeroC, Inc. All rights reserved.
5 // This copy of Ice is licensed to you under the terms described in the
6 // ICE_LICENSE file included in this distribution.
8 // **********************************************************************
14 public static void throwUOE(String expectedType
, String actualType
)
16 throw new Ice
.UnexpectedObjectException(
17 "expected element of type `" + expectedType
+ "' but received '" + actualType
,
18 actualType
, expectedType
);
21 public static void throwMemoryLimitException(int requested
, int maximum
)
23 throw new Ice
.MemoryLimitException("requested " + requested
+ " bytes, maximum allowed is " + maximum
+
24 " bytes (see Ice.MessageSizeMax)");
28 // A small utility to get the strack trace of the exception (which also includes toString()).
30 public static String
toString(java
.lang
.Throwable ex
)
32 java
.io
.StringWriter sw
= new java
.io
.StringWriter();
33 java
.io
.PrintWriter pw
= new java
.io
.PrintWriter(sw
);
34 ex
.printStackTrace(pw
);