Click here to Skip to main content

Design and Architecture

 
You must Sign In to use this message board.
Search this forum  
    Spacing  Noise  Layout  Per page  Show 
GeneralRe: Standard exceptions for an RPC library?memberjohndw9417 Aug '12 - 7:09 
Yes, all exceptions are already passed back to the client but the exception names are not standard across different languages. I am trying to come up with a table that will be translated to language-native exceptions.
AnswerRe: Standard exceptions for an RPC library?memberEddy Vluggen17 Aug '12 - 8:20 
johndw94 wrote:
the exception names are not standard across different languages

Can you clarify "different languages"?
 
Different in .NET? The classname of an IndexOutOfRangeException[^] is the same for each .NET language.
 
Different across all computer-languages, thus including the TIndexOutOfRangeException[^]? In that case, limit yourself to the exceptions that have already been reported.
 
Different across human languages? Try unlocalize.com[^]
 
Logging of exception-text in the English language? Set the culture to English when you ToString. You should be able to build that table for .NET by enumerating all the classes that inherit from Exception, using Reflection.
Bastard Programmer from Hell Suspicious | :suss:
if you can't read my code, try converting it here[^]

GeneralRe: Standard exceptions for an RPC library?memberjohndw9417 Aug '12 - 10:03 
Current targets are:
 
.NET (C# and VB.net mainly)
C++ (boost::exception)
Python
Java
MATLAB
Octave
SciLab
Perl
ActionScript
 
Possible targets are
PHP
TCL
 
None of them have common exception types.
GeneralRe: Standard exceptions for an RPC library?mvpRichard MacCutchan17 Aug '12 - 22:14 
The usual way round this is to have your library provide core functionality, and its own set of internal exceptions. You then add a wrapper for each language which maps method/function calls and internal library data to the types required by the language.
 
[edit]
Alternatively, forget about exceptions and just use return codes to indicate success or failure of client requests. XML offers many possible ways of achieving this.
[/edit]
One of these days I'm going to think of a really clever signature.

GeneralRe: Standard exceptions for an RPC library?memberjohndw9418 Aug '12 - 7:21 
My question was WHICH exceptions to wrap. I already implemented the rest of these comments a long time ago...
GeneralRe: Standard exceptions for an RPC library?mvpRichard MacCutchan18 Aug '12 - 9:29 
All of them, obviously. There is little point in writing a library that provides communication like .NET remoting or SOAP but is far more flexible in terms of supported languages and platforms, unless it can handle all types, which is, after all, what you claim to be doing.
One of these days I'm going to think of a really clever signature.

GeneralRe: Standard exceptions for an RPC library?memberaxpnumtheory18 Aug '12 - 9:32 
Yes, all exceptions are already passed back. They just don't have a common name. Passing the name of a C# exception to a Python program won't help much .There are a core set of exceptions that should be handled in a neutral manner. The question is, what are those core exceptions?
GeneralRe: Standard exceptions for an RPC library?mvpRichard MacCutchan18 Aug '12 - 9:36 
axpnumtheory wrote:
The question is, what are those core exceptions?
The only way such a question could be answered is to list every exception from every language that you plan to support and exclude any that are not common. I have no idea whether such a list has already been created by anyone else.
One of these days I'm going to think of a really clever signature.

QuestionRe: Standard exceptions for an RPC library?memberEddy Vluggen17 Aug '12 - 23:07 
johndw94 wrote:
None of them have common exception types.

Correct, and there's no standard or default.
 
What are you trying to achieve? Building a "unified" store for all application-exceptions? It'd be more appropriate to use an issue-tracker, so that's probably not it.
Bastard Programmer from Hell Suspicious | :suss:
if you can't read my code, try converting it here[^]

AnswerRe: Standard exceptions for an RPC library?memberjohndw9418 Aug '12 - 7:36 
No, the objective is to pass them back to the client. For instance, FileNotFoundException would be passed back to the client if the server couldn't find a file. Unfortunately in C# this would be System.IO.FileNotFoundException, while in python it would be IOError meaning that python will not have any idea what the C# exception is.
 
There are a huge number of exceptions defined in many languages. What do you think are the most "common" or "important"?

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   


Advertise | Privacy | Mobile
Web03 | 2.6.130523.1 | Last Updated 24 May 2013
Copyright © CodeProject, 1999-2013
All Rights Reserved. Terms of Use
Layout: fixed | fluid