Giter Club home page Giter Club logo

Comments (7)

 avatar commented on July 22, 2024 1

it works now

from rosu.

MaxOhn avatar MaxOhn commented on July 22, 2024

One of OsuError's variants is Serde which includes both why the variable couldn't be deserialized, and what the api response was.
The api response in your case couldn't be deserialized because instead of user info you got an api error, so rosu just forwards that message to you.
I agree though that it should catch api errors a little better so with PR #3 it'll try to deserialize api errors.
This can still fail though in case of cloudflare issues or other HTML responses I can't anticipate, in which case it'll default to the Serde error as before.

The way to handle responses would be

let user: User = match request.queue_single(&osu).await {
    Ok(Some(user)) => user,
    Ok(None) => panic!("No such user"),
    Err(why) => panic!("rosu error: {}, why),
};

from rosu.

 avatar commented on July 22, 2024

ah yes, now i see it.

`Result::unwrap()` on an `Err` value: Serde(Error(

I don't really see what's wrong with my code. I guess I'll figure it out.

from rosu.

MaxOhn avatar MaxOhn commented on July 22, 2024

Are you sure the api key is correct? Does the username maybe contain whitespace?
If it does contain whitespace, I opened the issue #4 about a related bug.
In case you currently import via rosu = "0.3", try importing via
rosu = { git = "https://github.com/MaxOhn/rosu", branch = "master" }
instead for now, at least until v0.3.1 is on crates.io

from rosu.

 avatar commented on July 22, 2024

The username doesn't contain whitespace, but now that you say that I'm not sure what I'm using is right. Is it just the "client secret" from the oauth thingy? because yeah, I'm 100% sure that's correct

from rosu.

MaxOhn avatar MaxOhn commented on July 22, 2024

https://github.com/ppy/osu-api/wiki#requesting-access
Here's where you currently get your api key

from rosu.

 avatar commented on July 22, 2024

ooohhh so its different from the oauth applications? i see

from rosu.

Related Issues (2)

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.