Fix to parse API error
This commit is contained in:
parent
fe02b9e6af
commit
aa0f9563ac
4 changed files with 21 additions and 7 deletions
3
apps.go
3
apps.go
|
@ -3,7 +3,6 @@ package mastodon
|
|||
import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"path"
|
||||
|
@ -64,7 +63,7 @@ func RegisterApp(ctx context.Context, appConfig *AppConfig) (*Application, error
|
|||
defer resp.Body.Close()
|
||||
|
||||
if resp.StatusCode != http.StatusOK {
|
||||
return nil, fmt.Errorf("bad request: %v", resp.Status)
|
||||
return nil, parseAPIError("bad request", resp)
|
||||
}
|
||||
|
||||
var app Application
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue