public override bool Like(SemanticException other) { bool result = base.Like(other); ObjectAlreadyChangedException otherObjectAlreadyChangedException = other as ObjectAlreadyChangedException; return(result && otherObjectAlreadyChangedException != null && Sender == otherObjectAlreadyChangedException.Sender); }
public override bool Like(SemanticException other) { bool result = base.Like(other); IdNotFoundException <T, TId> otherIdNotFoundException = other as IdNotFoundException <T, TId>; return(result && otherIdNotFoundException != null && PersistentObjectType == otherIdNotFoundException.PersistentObjectType && EqualityComparer <TId> .Default.Equals(Id, otherIdNotFoundException.Id)); }
public override bool Like(SemanticException other) { bool result = base.Like(other); RepositorySqlException otherRepositorySqlException = other as RepositorySqlException; return(result && otherRepositorySqlException != null && string.Equals(SqlString, otherRepositorySqlException.SqlString, StringComparison.Ordinal) && string.Equals(Constraint, otherRepositorySqlException.Constraint, StringComparison.Ordinal)); }
protected virtual MessageList BuildMessageList([NotNull] ExceptionContext context, [NotNull] SemanticException se) { IEnumerable <Message> result = Translate(context, (dynamic)se); return(new MessageList { Messages = result.ToArray() }); }
protected virtual HttpStatusCode DetermineHttpStatusCode([NotNull] SemanticException se) => HttpStatusCode.BadRequest;
protected virtual IEnumerable <Message> Translate([NotNull] ExceptionContext context, [NotNull] SemanticException se) { StringBuilder sb = new StringBuilder(); sb.AppendLine(se.Message); if (_environmentsConsideredAsDevelopment.Contains(HostEnvironment.EnvironmentName)) { Exception e = se.InnerException; while (e != null) { sb.AppendLine(e.Message); e = e.InnerException; } } yield return(BuildMessage(sb.ToString())); }