Improve error handling in ShowSchedules component and remove unnecessary logging in schedule API

- Updated error messaging in the ShowSchedules component to provide more informative feedback when a schedule fails to run.
- Removed redundant console logging in the schedule API to streamline error handling and improve code cleanliness.
This commit is contained in:
Mauricio Siu
2025-05-02 16:18:05 -06:00
parent 1f6ba45c12
commit c69992c4f0
2 changed files with 1 additions and 4 deletions

View File

@@ -139,9 +139,7 @@ export const ShowSchedules = ({ applicationId }: Props) => {
.catch((error) => { .catch((error) => {
console.log(error); console.log(error);
toast.error( toast.error(
error instanceof Error `Error running schedule: ${error}`,
? error.message
: "Error running schedule",
); );
}); });
}} }}

View File

@@ -99,7 +99,6 @@ export const scheduleRouter = createTRPCRouter({
await runCommand(input.scheduleId); await runCommand(input.scheduleId);
return true; return true;
} catch (error) { } catch (error) {
console.log(error);
throw new TRPCError({ throw new TRPCError({
code: "INTERNAL_SERVER_ERROR", code: "INTERNAL_SERVER_ERROR",
message: message: