-
Notifications
You must be signed in to change notification settings - Fork 207
Description
The recently added AdsOverMQTT connection type now throws a barebone Exception
with some message as AmsServer 'AdsOverMqtt' is not set!
While I understand that there is a way to configure the connection to be ADS-only, I still believe that the exception here should be some sort of AmsServerException
or other identifiable implementation and not a random Exception
to handle it distinctly.
Note that previously, with no connection setup, it was either LoopbackNotRegisteredException
or AdsServerException
that was thrown here and it was possible to rely on that to handle the cases. Now one would need to rely on the message of the exception which is undesired.
Please consider using some existing exception type such as AdsServerException
or add a new type instead (as suggested above: AmsServerException
sounds legit to me) instead of falling back to generic Exception
type.
System.Exception: AmsServer 'AdsOverMqtt' is not set!
at TwinCAT.Ads.AmsServerComposition.GetServerFactory(ChannelProtocol channelProtocol)
at TwinCAT.Ads.Server.AmsServer.createDIChannel(ChannelProtocol requestedProtocol, ChannelPortType requestedPortType)
at TwinCAT.Ads.Server.AmsServer.createServerImplementation(ChannelProtocol requestedProtocol, ChannelPortType requestedPortType)
at TwinCAT.Ads.Server.AmsServer.ConnectServer()
at TwinCAT.Ads.Server.AdsServer.ConnectServer()
at TwinCAT.Ads.AdsClient.Connect(AmsAddress address)
at TwinCAT.Ads.AdsConnection.OnConnect()
at TwinCAT.Ads.AdsConnection.Connect()
at TwinCAT.Ads.AdsSessionBase.OnConnect(Boolean reconnect)
at TwinCAT.Session.Connect()