the-deep / deeper

it's like DEEP, but with more DEEP
https://app.thedeep.io/
GNU Affero General Public License v3.0
7 stars 4 forks source link

Communicate extra data with error #962

Closed AdityaKhatri closed 3 years ago

thenav56 commented 3 years ago

@tnagorra @AdityaKhatri . Does this works?

2020-11-06-114921.png

AdityaKhatri commented 3 years ago

Works for me @Navin-Ayer . @tnagorra , waiting for your feedback.

tnagorra commented 3 years ago

Yes, should work!

tnagorra commented 3 years ago

@Navin-Ayer

Previously, we have this schema for errors:

{
   errors: { non_field_errors: ["error", "some error"], some_other_field: "string", yet_another_field: "string" }
}

To add data to what error we have, we should update non_field_errors to include objects:

{
   errors: { non_field_errors: [{ message: "error": leads: []}], some_other_field: "string", yet_another_field: "string" }
}