/// <summary> Executes the API exception action. </summary> /// /// <remarks> Paul, 25/01/2015. </remarks> /// /// <param name="sender"> The sender. </param> /// <param name="e"> The ExceptionWithCtx to process. </param> public void OnApiException(object sender, ExceptionWithCtx e) { if (e.m_e is ApiException) { ApiException apiE = (ApiException)e.m_e; if (e.m_ctx.ListenerResponse.Headers.Count == 0) { //e.m_ctx.Respond<ApiError>(apiE.m_error); SendCorsResponse <ApiError>(e.m_ctx, apiE.m_error); } } else if (e.m_ctx != null) { m_database.LogGeneralException(e.m_e.ToString()); if (e.m_ctx.ListenerResponse.Headers.Count == 0) { //e.m_ctx.Respond<ApiError>(new ApiExceptionGeneral().m_error); SendCorsResponse <ApiError>(e.m_ctx, new ApiExceptionGeneral().m_error); } } else { throw e.m_e; } }
void OnServerException(object sender, ExceptionWithCtx e) { if (ExceptionEvent != null) { ExceptionEvent(sender, e); } }
/// <summary> Executes the API exception action. </summary> /// /// <remarks> Paul, 25/01/2015. </remarks> /// /// <param name="sender"> The sender. </param> /// <param name="e"> The ExceptionWithCtx to process. </param> void OnApiException(object sender, ExceptionWithCtx e) { if (e.m_e is ApiException) { ApiException apiE = (ApiException)e.m_e; e.m_ctx.Respond <ApiError>(apiE.m_error); } else { e.m_ctx.Respond <ApiError>(new ApiExceptionGeneral().m_error); } }
static void OnServerException(object sender, ExceptionWithCtx e) { m_gServer.m_Api.OnApiException(sender, e); m_gServer.m_Database.LogGeneralException(e.m_e.ToString()); }
/// <summary> Executes the API exception action. </summary> /// /// <remarks> Paul, 25/01/2015. </remarks> /// /// <param name="sender"> The sender. </param> /// <param name="e"> The ExceptionWithCtx to process. </param> void OnApiException(object sender, ExceptionWithCtx e) { if (e.m_e is ApiException) { ApiException apiE = (ApiException)e.m_e; e.m_ctx.Respond<ApiError>(apiE.m_error); } else { e.m_ctx.Respond<ApiError>(new ApiExceptionGeneral().m_error); } }