Skip to content

Commit

Permalink
Handle mixcloud 400 errors.
Browse files Browse the repository at this point in the history
  • Loading branch information
stefansundin committed Apr 6, 2021
1 parent ee8fbfc commit 953e6ab
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions app.rb
Original file line number Diff line number Diff line change
Expand Up @@ -858,6 +858,7 @@
path, _ = App::Cache.cache("mixcloud.user", username.downcase, 24*60*60, 60) do
response = App::Mixcloud.get("/#{username}/")
next "Error: Can't find a user with that name." if response.code == 404
next "Error: Please enter a valid username." if response.code == 400
raise(App::MixcloudError, response) if !response.success?
data = response.json
"#{data["username"]}/#{data["name"]}"
Expand Down

0 comments on commit 953e6ab

Please sign in to comment.