From 953e6abbde6a3648853b0194b19f23c9c99d45da Mon Sep 17 00:00:00 2001 From: Stefan Sundin Date: Mon, 5 Apr 2021 21:19:56 -0700 Subject: [PATCH] Handle mixcloud 400 errors. --- app.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/app.rb b/app.rb index 3df0dd3..412cdc5 100644 --- a/app.rb +++ b/app.rb @@ -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"]}"