summaryrefslogtreecommitdiff
path: root/cpp/src/Ice/Exception.cpp
diff options
context:
space:
mode:
authorDwayne Boone <dwayne@zeroc.com>2009-04-21 11:03:19 -0230
committerDwayne Boone <dwayne@zeroc.com>2009-04-21 11:03:19 -0230
commitd6bbb689749d7eb25728feb2426fe4d9bcaaee69 (patch)
treedf16c64ea4c2f728b435982660deea43f0252433 /cpp/src/Ice/Exception.cpp
parentBug 3957 - ensure python that starts scripts is same as one it uses internally (diff)
downloadice-d6bbb689749d7eb25728feb2426fe4d9bcaaee69.tar.bz2
ice-d6bbb689749d7eb25728feb2426fe4d9bcaaee69.tar.xz
ice-d6bbb689749d7eb25728feb2426fe4d9bcaaee69.zip
Bug 2798 - add reason information to MemoryLimitException
Diffstat (limited to 'cpp/src/Ice/Exception.cpp')
-rw-r--r--cpp/src/Ice/Exception.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/cpp/src/Ice/Exception.cpp b/cpp/src/Ice/Exception.cpp
index 01778f4d7f9..35a14621375 100644
--- a/cpp/src/Ice/Exception.cpp
+++ b/cpp/src/Ice/Exception.cpp
@@ -32,6 +32,14 @@ throwUOE(const string& expectedType, const string& actualType)
actualType, expectedType);
}
+void
+throwMemoryLimitException(const char* file, int line, size_t requested, size_t maximum)
+{
+ ostringstream s;
+ s << "requested " << requested << " bytes, maximum allowed is " << maximum << " bytes (see Ice.MessageSizeMax)";
+ throw Ice::MemoryLimitException(file, line, s.str());
+}
+
}
}