Skip to content

Commit

Permalink
Ignore not authenticated error in updateOsmUsernameState
Browse files Browse the repository at this point in the history
  • Loading branch information
starsep committed Feb 15, 2024
1 parent ed7909a commit 8b9e72f
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/osm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,10 @@ export function updateOsmUsernameState(
) {
auth.xhr(
{ method: "GET", path: "/api/0.6/user/details" },
(err: Error, result: XMLDocument) => {
// result is an XML DOM containing the user details
if (err) {
console.log(err);
throw err;
(error: Error, result: XMLDocument) => {
if (error) {
if (String(error) !== "not authenticated") throw error;
return;
}
const userObject = result.getElementsByTagName("user")[0];
const username = userObject.getAttribute("display_name");
Expand Down

0 comments on commit 8b9e72f

Please sign in to comment.