You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
ServerRpcContext.Exception is of type Exception, but ClientRpcContext property is of RemoteInvocationException type.
If server-side AfterCall event handler wraps around the exception, client may not be able to receive it.
To Reproduce
// remote call results in a typical database error report:// 23503: delete from table 'clients' violates foreign key constraint 'order_client_fk' on table 'orders'proxy.DeleteRecord(clientId);// server sets up a centralized exception logger and translator:// real error report is logged somewhere, and friendly translation is sent to the clientserver.AfterCall+=(sender,ctx)=>{// replace cryptic database error report with a user-readable error messageif(ctx.Exception!=null&&ctx.Exception.Message.StartsWith("23503:"))ctx.Exception=newException("Deleting clients is not allowed.",ctx.Exception);}
Expected behavior
The client should be able to get any exception from server as long as it is deserializable.
The text was updated successfully, but these errors were encountered:
yallie
added a commit
to yallie/CoreRemoting
that referenced
this issue
Dec 10, 2024
Describe the bug
ServerRpcContext.Exception is of type Exception, but ClientRpcContext property is of RemoteInvocationException type.
If server-side AfterCall event handler wraps around the exception, client may not be able to receive it.
To Reproduce
Expected behavior
The client should be able to get any exception from server as long as it is deserializable.
The text was updated successfully, but these errors were encountered: