Exemple #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Fault"/> class.
 /// </summary>
 /// <param name="errorMessage">A Flex error message.</param>
 internal Fault(ErrorMessage errorMessage)
 {
     _content = errorMessage;
     _faultCode = errorMessage.faultCode;
     _faultDetail = errorMessage.faultDetail;
     _faultString = errorMessage.faultString;
     _rootCause = errorMessage.rootCause;
 }
        public static JavaScriptObject FromException(ErrorMessage message, bool includeStackTrace)
        {
            ValidationUtils.ArgumentNotNull(message, "message");

            JavaScriptObject error = new JavaScriptObject();
            error.Add("name", "JSONRPCError");
            error.Add("message", message.faultString);
            error.Add("code", message.faultCode);

            if (includeStackTrace)
                error.Add("stackTrace", message.faultDetail);

            error.Add("errors", null);
            return error;
        }
 private object FromException(ErrorMessage message)
 {
     return JsonRpcError.FromException(message, false);
 }
		/// <summary>
		/// Initializes a new instance of the ErrorResponseBody class.
		/// </summary>
		/// <param name="requestBody"></param>
		/// <param name="message"></param>
		/// <param name="errorMessage"></param>
		public ErrorResponseBody(AMFBody requestBody, IMessage message, ErrorMessage errorMessage):base(requestBody)
		{
			Content = errorMessage;
            Target = requestBody.Response + AMFBody.OnStatus;
			IgnoreResults = requestBody.IgnoreResults;
			Response = "";
		}
 protected override MessageBase CopyImpl(MessageBase clone)
 {
     // Instantiate the clone, if a derived type hasn't already.
     if (clone == null) clone = new ErrorMessage();
     // Allow base type(s) to copy their state into the new clone.
     base.CopyImpl(clone);
     // Copy our state into the clone.
     ((ErrorMessage)clone)._faultCode = _faultCode;
     ((ErrorMessage)clone)._faultString = _faultString;
     ((ErrorMessage)clone)._faultDetail = _faultDetail;
     ((ErrorMessage)clone)._rootCause = _rootCause;
     ((ErrorMessage)clone)._extendedData = _extendedData;
     return clone;
 }
		internal virtual ErrorMessage GetErrorMessage()
		{
			ErrorMessage errorMessage = new ErrorMessage();
			errorMessage.faultCode = this.FaultCode;
			errorMessage.faultString = this.Message;
//#if DEBUG
            if (FluorineConfiguration.Instance.FluorineSettings.CustomErrors.Mode == "Off")
            {
                if (FluorineConfiguration.Instance.FluorineSettings.CustomErrors.StackTrace)
                {
                    if (this.InnerException != null)
                    {
                        errorMessage.faultDetail = this.InnerException.StackTrace;
                        if (this.ExtendedData != null)
                            this.ExtendedData["FluorineStackTrace"] = this.StackTrace;
                    }
                    else
                        errorMessage.faultDetail = this.StackTrace;
                }
                if (this.RootCause != null)
                    errorMessage.rootCause = this.RootCause;
            }
//#endif
            errorMessage.extendedData = this.ExtendedData;
			return errorMessage;
		}