Staff have a my C # code that has the code:
Uri resultadoURL;
bool resultado = Uri.TryCreate(Configuracoes.Configuracao.URL, UriKind.Absolute, out resultadoURL) && resultadoURL.Scheme == Uri.UriSchemeHttp;
if (!resultado)
throw new Exception(String.Format("URL '{0}' não é válida!", Configuracoes.Configuracao.URL));
In the try / catch, the ex.Message, instead of showing 'URL' xxx 'is not valid ", is showing the message" Message an exception was thrown by the target of an invocation. "
Try / catch block
catch (Exception ex)
{
try
{
Send(state.State, ToJson(new ResultadoDaIntegracao(false, ex.Message, null)));
}
catch { }
}
Does anyone know why ex.Message comes different?