Base solution for your next web application
Open Closed

What is the details error object @clientside #606


User avatar
0
patrickglaudemans created

Hi,

Zero/abp logs entity validation errors – great! ERROR 2015-12-22 11:36:58,854 [7 ] BI.EntityFramework.BIDbContext - There are some validation errors while saving changes in EntityFramework: ERROR 2015-12-22 11:36:58,854 [7 ] BI.EntityFramework.BIDbContext - - Site: The Site field is required. ERROR 2015-12-22 11:36:59,071 [7 ] lers.Filters.AbpExceptionFilterAttribute - System.Data.Entity.Validation.DbEntityValidationException: Validation failed for one or more entities. See 'EntityValidationErrors' property for more details. at System.Data.Entity.Internal.InternalContext.SaveChangesAsync(CancellationToken cancellationToken) at System.Data.Entity.Internal.LazyInternalContext.SaveChangesAsync(CancellationToken cancellationToken) at System.Data.Entity.DbContext.SaveChangesAsync(CancellationToken cancellationToken) at Abp.EntityFramework.AbpDbContext.<>n__FabricatedMethod2(CancellationToken ) at Abp.EntityFramework.AbpDbContext.<SaveChangesAsync>d__0.MoveNext()

What is, a@client side, the detail object – see below. (validationErrors are clientside val errors)

abp.js:174 ERROR: abp.js:174 Object {code: 0, message: "An internal error occurred during your request!", details: null, validationErrors: null}

Regards, P


1 Answer(s)
  • User Avatar
    0
    hikalkan created
    Support Team

    details is used if you send exception details to the client (<a class="postlink" href="http://www.aspnetboilerplate.com/Pages/Documents/Startup-Configuration#DocConfigureModules">http://www.aspnetboilerplate.com/Pages/ ... ureModules</a>). It stores the stack trace. Also, it's a general-purpose property that can be used in various cases (you can directly return AjaxResponse object from an MVC controller, for example. see AjaxResponse object: <a class="postlink" href="https://github.com/aspnetboilerplate/aspnetboilerplate/blob/master/src/Abp.Web/Web/Models/AjaxResponse.cs">https://github.com/aspnetboilerplate/as ... esponse.cs</a>). And also you can throw UserFriendlyException and set Details property to send to the client (<a class="postlink" href="http://www.aspnetboilerplate.com/Pages/Documents/Handling-Exceptions#DocShowUserFriendlyExceptions">http://www.aspnetboilerplate.com/Pages/ ... Exceptions</a>).

    This is generally handled internally by ABP framework, you don't care it in most cases.