Black Friday Sale!
Save up to 50% off any plans! Valid from 23 Nov to 30 Nov - Also valid for the existing customers
Open Closed

Change API error wrapping format #9513


0
samara081 created

Hi,

I need to do minor changes for some api response exception wrapping, from

{
  "result": null,
  "targetUrl": null,
  "success": false,
  "error": {
    "code": 0,
    "message": "Error Message",
    "details": null,
    "validationErrors": null
  },
  "unAuthorizedRequest": false,
  "__abp": true
}

to be

{
  "result": null,
  "targetUrl": null,
  "IsSuccess": false,
  "error": {
    "code": 0,
    "message": "Error Message",  
  },
  "__abp": true
}

Is their any way to do it?


3 Answer(s)
  • 0
    maliming created
    Support Team

    hi

    These properties are used in many methods, You should not change it for no particular reason.

    Can you share the reason?

  • 0
    samara081 created

    We just need it for a few APIs, as these APIs are used by specific client system as integration points. and this client require us to change the error format. i know the client should change it, however we are enforced by the customer to change it from our side

  • 0
    maliming created
    Support Team

    Hi

    You can consider to use the DontWrapResult .

    https://aspnetboilerplate.com/Pages/Documents/Javascript-API/AJAX?#wrapresult-and-dontwrapresult-attributes