Comments (7)
it works now
from rosu.
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.
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.
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.
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.
https://github.com/ppy/osu-api/wiki#requesting-access
Here's where you currently get your api key
from rosu.
ooohhh so its different from the oauth applications? i see
from rosu.
Related Issues (2)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rosu.