diff options
author | Chris Wilson <chris+github@qwirx.com> | 2015-08-06 21:20:48 +0000 |
---|---|---|
committer | Chris Wilson <chris+github@qwirx.com> | 2015-08-06 21:20:48 +0000 |
commit | d9bd0cf3dd9f740e9482cb83e299383aac1495c9 (patch) | |
tree | d2b9d0688904e7143a86ada117bb8535325fbd6e /lib/server/makeprotocol.pl.in | |
parent | 4c4ea17010dc4f661d96f1e0a355a2b020544525 (diff) |
Handle generic exceptions by returning an Error message with correct Type.
Diffstat (limited to 'lib/server/makeprotocol.pl.in')
-rwxr-xr-x | lib/server/makeprotocol.pl.in | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/server/makeprotocol.pl.in b/lib/server/makeprotocol.pl.in index ac214e92..d6c0e216 100755 --- a/lib/server/makeprotocol.pl.in +++ b/lib/server/makeprotocol.pl.in @@ -331,7 +331,9 @@ __E { $error_message = $cmd; my ($mem_type,$mem_subtype) = split /,/,obj_get_type_params($cmd,'IsError'); + my $error_type = $cmd_constants{"ErrorType"}; print H <<__E; + $cmd_class(int SubType) : m$mem_type($error_type), m$mem_subtype(SubType) { } bool IsError(int &rTypeOut, int &rSubTypeOut) const; std::string GetMessage() const { return GetMessage(m$mem_subtype); }; static std::string GetMessage(int subtype); @@ -1102,7 +1104,7 @@ void $server_or_client_class\::DoServer($context_class &rContext) // or the exception handler fails as well. This path // throws the exception upwards, killing the process // that handles the current client. - Send($cmd_classes{$error_message}()); + Send($cmd_classes{$error_message}(-1)); throw; } |