My Products
Help
Florian Haase
PARTNER

Error-Codes

by Florian Haase (Updated ‎30-05-2023 11:59 by Florian Haase PARTNER )

Hi,

 

does there exists a documentation about the errror-statuses returned by API - ref 

https://docs.business.visma.net/docs/features/errors

 

"extensions": {
"data": {
"status": 3
}
}

 

is there an own status for "already exists"?

 

Florian

 

 

4 REPLIES 4

by Marius Bancila

We have added support for including status code names in the response. Example:

 

{
  "errors": [
    {
      "message": "A record with the same primary key already exists.",
      "path": [
        "useCompany",
        "order_create",
        "values/0"
      ],
      "extensions": {
        "data": {
          "status": 3,
          "status_name": "PrimaryKeyAssignmentFailed"
        }
      }
    }
  ],
  "data": {
    "useCompany": {
      "order_create": {
        "items": null
      }
    }
  }
}

 

You can read about it here: https://docs.business.visma.net/docs/features/errors#understanding-error-information

 

Florian Haase
PARTNER

by Florian Haase

Hi Marius,

 

yes, but do you know what the meanings of the codes are? Which can we except and what does the codes say us?

 

Florian

Accepted solution
Marius Bancila
VISMA

by Marius Bancila (Updated ‎07-07-2023 10:14 by Marius Bancila VISMA )

By definition we should know the meaning of error codes, yes. 🙂

 

Are you asking if we can specify what error codes a certain operation can return?

 

No, not really. If you do an operation like an insert, that's composed of multiple suboperations and each of these may return different error codes. However, these error codes are returned from the backend (VBus). There is nothing generated in GraphQL. And many of them would not tell you much even if we return their name/description rather than the code. That's why we have chosen to return numerical values that you can report back to us when you have an error.

 

I will open up an internal discussion to evaluate whether we can/should return code names not just code values.

by Marius Bancila

These are internal error codes, that's why they are returned as numbers