Skip to content

Fix: Improve 401 Unauthorized messages#58

Open
soe-relewise wants to merge 2 commits into
mainfrom
fix/use-error-message-provided-by-api-for-401
Open

Fix: Improve 401 Unauthorized messages#58
soe-relewise wants to merge 2 commits into
mainfrom
fix/use-error-message-provided-by-api-for-401

Conversation

@soe-relewise
Copy link
Copy Markdown
Collaborator

@soe-relewise soe-relewise requested a review from mzanoni May 12, 2026 11:22
Copy link
Copy Markdown
Collaborator

@mzanoni mzanoni left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some feedback, otherwise nice work :)

Comment thread src/RelewiseClient.php Outdated
? $response->body
: ($response->body === null ? null : json_encode($response->body));

if ($message === null || $message === false || $message === "")
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the key is wrong or missing you get this response:

Image

Also we want to improve the error handling and falling back to "Unauthorized" is not much of an help.

Can we tell the user to verify that:

  • they have provided a api key
  • that the api key has permission to call the endpoint they are trying to hit
  • Maybe also check that the dataset id and serverurl is correct (api key might be a valid one, but belong to a prod dataset instead of stage eg)

@soe-relewise soe-relewise requested a review from mzanoni May 12, 2026 12:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants