Cannot remove or change server exception prefix from registered exception types


(arturomonge) #1


I’ve been tracking down why I can’t remove the server exception prefix in my .NET app, from exceptions generated by the server. I realized the problem is this code in Message.cs:

		protected Exception CreateException(String exceptionName, String message)
		Type lType = TypeManager.FindType(exceptionName);
		if (lType != null)
			Exception lResult = SerializerInstance.ReadException("ROException", message, lType, true);

			if (lResult != null)
				return lResult;

If the exception is a registered type, the fromServer param of SerializerInstance.ReadException is sent as always true, and the code in ServerException.cs then adds the default SERVER_EXCEPTION_MESSAGE, which cannot be changed, translated or removed. I would have expected that the message’s AddServerExceptionPrefix and ServerExceptionPrefix were used for any exception received by the server, but this is not the case if the exception is a registered type. Is this WAD or something that perhaps could be changed in the future?


(antonk) #2


No, this doesn’t work as it was intended to. We’ll review the logic here to make it more manageable.


(RemObjects) #3

Thanks, logged as bugs://79321

(RemObjects) #4

bugs://79321 got closed with status fixed.