Git Product home page Git Product logo

Comments (4)

Losik avatar Losik commented on May 25, 2024

Hello, Vladislav!
Unfortunately, I failed to reproduce your error with set_user_skill method.

If I pass wrong skill_id, I get

ValidationApiError(
    status_code=400, 
    request_id='ac775943dff967d8df8f3a22a65f2c5b', 
    code='VALIDATION_ERROR', 
    message='Validation failed', 
    payload={'skill_id': {'code': 'ENTITY_DOES_NOT_EXIST', 'message': 'Entity does not exist'}}
)

If I pass wrong user_id, I get

ValidationApiError(
    status_code=400,
    request_id='9b9fed94164f7365aa4978c695afd169', 
    code='VALIDATION_ERROR', 
    message='Validation failed', 
    payload={'user_id': {'code': 'ENTITY_DOES_NOT_EXIST', 'message': 'Entity does not exist'}}
)

For me both errors had status codes 400, not 404 and the actual reason could be deduced from the payload attribute of the error.

Could you please provide a minimal example to reproduce the problem?

from toloka-kit.

TanVD avatar TanVD commented on May 25, 2024

Oh, that's on me.

Yeah, I did got 400 too (did not notice specific status code and thought it would be 404, since the code says DOES_NOT_EXIST. As for the eloquence, I just did not notice that in a payload the first parts says which specific parameters are missing on a Toloka's backend.

TBH, the message is not really friendly from my point of view, but not sure that is an issue.

from toloka-kit.

Losik avatar Losik commented on May 25, 2024

I will double-check the error format and

  • if backend guarantees that payload may only contain one error, we can raise more specific errors
  • if not, we can think about more user-friendly exception message

from toloka-kit.

Pocoder avatar Pocoder commented on May 25, 2024

Exceptions are enhanced in #106

from toloka-kit.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.