Skip to content

Commit

Permalink
[backend/frontend] wip
Browse files Browse the repository at this point in the history
  • Loading branch information
savacano28 committed Dec 20, 2024
1 parent 81f40c9 commit 4b85cf0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ public class LogApi extends RestBehavior {

@PostMapping("/api/logs/frontend-error")
public void logError(@RequestBody ErrorDetailsInput errorDetails) {
logger.error("Error received: " + errorDetails);
logger.error(
"Message error received: {} stacktrace: {} at {}",
errorDetails.getMessage(),
errorDetails.getStack(),
errorDetails.getTimestamp());
}
}
2 changes: 1 addition & 1 deletion openbas-front/src/utils/Action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ export const bulkDeleteReferential = (uri: string, type: string, data: unknown)
export const sendErrorToBackend = async (error: Error, stack: ErrorInfo) => {
const errorDetails = {
message: error.message,
stack: stack,
stack: stack.componentStack,
timestamp: new Date().toISOString(),
};
simplePostCall('/api/logs/frontend-error', errorDetails)
Expand Down

0 comments on commit 4b85cf0

Please sign in to comment.