コード例 #1
0
        public override bool HandleError(Exception ex, ErrorPipelineContext ctx)
        {
            string message = ErrorMessage ?? String.Format("Error processing action: {0}", GetType().Name);

            Log.Error().Project(ctx.Error.ProjectId).Message(message).Exception(ex).Write();

            if (!ctx.Error.Tags.Contains("Internal"))
            {
                ErrorBuilder b = ex.ToExceptionless()
                                 .AddDefaultInformation()
                                 .AddObject(ctx.Error)
                                 .AddTags("Internal")
                                 .SetUserDescription(message);

                b.AddTags(ErrorTags);

                if (IsCritical)
                {
                    b.MarkAsCritical();
                }

                b.Submit();
            }

            return(ContinueOnError);
        }