Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
  • Loading branch information
LucasCharrier authored Nov 19, 2024
1 parent 113763a commit 36d64e6
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/lib/matomo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ export class Matomo implements AccountService {

if (!response.ok) {
throw new Error(
`Matomo: Error fetching user: ${response.statusText}`
`Matomo: Error fetching user ${email}: ${response.statusText}`
);
}
const users = await response.json();
Expand All @@ -130,7 +130,7 @@ export class Matomo implements AccountService {

if (!response.ok) {
throw new Error(
`Matomo: Error deleting user: ${response.statusText}`
`Matomo: Error deleting user ${userLogin}: ${response.statusText}`
);
}

Expand Down Expand Up @@ -209,7 +209,7 @@ export class Matomo implements AccountService {
// if sucess response body = { result: 'success', message: 'ok' }
if (responseBody.result === "error") {
throw new Error(
`Matomo: Failed to create user: ${responseBody.result}`
`Matomo: Failed to create user ${userLogin}: ${responseBody.result}`
);
}
console.log(`Matomo: User created with login : ${userLogin}`);
Expand Down Expand Up @@ -263,7 +263,7 @@ export class Matomo implements AccountService {
);
return;
} catch (error) {
console.error("Failed to set user access:", error);
console.error(`Failed to set user access for ${userLogin}:`, error);
throw error;
}
}
Expand Down Expand Up @@ -339,7 +339,7 @@ export class Matomo implements AccountService {
// Check if the response is ok and handle errors
if (!response.ok) {
throw new Error(
`Matomo : Failed to create site: ${response.statusText}`
`Matomo : Failed to create site: ${response.statusText} ${urls.join(',')}`
);
}
console.log(`Matomo: Site created with url : ${urls.join(",")}`);
Expand Down

0 comments on commit 36d64e6

Please sign in to comment.