Git Product home page Git Product logo

Comments (2)

Ervie avatar Ervie commented on July 29, 2024

I think it's up to the user to decide what to do in a situation when the error is encountered - by default all the errors are thrown to the upper level so the user can catch and decide if they want to retry based on error code. Some of them indicate that retrying is won't work, for example non existent id that you mention (it will throw JikanRequestException with StatusCode 404). No the other hand you might met status error 429, meaning there are too many request at once coming from you bot - you might want to wait a little bit and retry the call.

On the other hand wrapper has built-in error supression. You just pass second parameter in a constructor like this:
var jikan = new Jikan(true, true)
Now every failed result will be returned as null and you just perform a null check. But I would still suggest using try catch: https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/try-catch

from jikan.net.

ProjektCode avatar ProjektCode commented on July 29, 2024

Sorry, still new at debugging and learning and really didn't understand how to use Try/Catch. Figured it out.

from jikan.net.

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.