Skip to content

Commit

Permalink
fix(logging): improve error handling by explicitly casting error to E…
Browse files Browse the repository at this point in the history
…rror for better clarity in data source alerts handling
  • Loading branch information
guidomodarelli committed Dec 12, 2024
1 parent 7a2c1f2 commit 5a9c0de
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export class DataSourceAlertsStateContainer implements StateContainer {

return result;
} catch (error) {
this.logger.error(`Error getting data: ${error.message}`);
this.logger.error(`Error getting data: ${(error as Error).message}`);
throw error;
}
}
Expand All @@ -78,7 +78,7 @@ export class DataSourceAlertsStateContainer implements StateContainer {
this.logger.debug(`Encoded data was set: ${encodedData}`);
}
} catch (error) {
this.logger.error(`Error setting data: ${error.message}`);
this.logger.error(`Error setting data: ${(error as Error).message}`);
// TODO: implement
// const options = {
// context: `${AppState.name}.setClusterInfo`,
Expand Down Expand Up @@ -106,7 +106,7 @@ export class DataSourceAlertsStateContainer implements StateContainer {

return result;
} catch (error) {
this.logger.error(error.message);
this.logger.error((error as Error).message);
throw error;
}
}
Expand Down

0 comments on commit 5a9c0de

Please sign in to comment.