muralim1969 commented on code in PR #42: URL: https://github.com/apache/activemq-nms-openwire/pull/42#discussion_r2203363026
########## src/Util/ExceptionFromBrokerError.cs: ########## @@ -0,0 +1,78 @@ +using Apache.NMS.ActiveMQ.Commands; +using System; +using System.Reflection; + + +namespace Apache.NMS.ActiveMQ.Util +{ + internal class ExceptionFromBrokerError + { + public static NMSException CreateExceptionFromBrokerError(BrokerError brokerError) + { + String exceptionClassName = brokerError.ExceptionClass; + + if (String.IsNullOrEmpty(exceptionClassName)) + { + return new BrokerException(brokerError); + } + + NMSException exception = null; + String message = brokerError.Message; + + // We only create instances of exceptions from the NMS API + Assembly nmsAssembly = Assembly.GetAssembly(typeof(NMSException)); + + // First try and see if it's one we populated ourselves in which case + // it will have the correct namespace and exception name. + Type exceptionType = nmsAssembly.GetType(exceptionClassName, false, true); Review Comment: This method is called only in the exception scenario and this optimization is not required -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: gitbox-unsubscr...@activemq.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: gitbox-unsubscr...@activemq.apache.org For additional commands, e-mail: gitbox-h...@activemq.apache.org For further information, visit: https://activemq.apache.org/contact