mirror of
https://github.com/gchq/CyberChef
synced 2025-12-17 16:53:45 +00:00
Changed all error returns to OperationErrors
This commit is contained in:
@@ -67,7 +67,7 @@ class TranslateDateTimeFormat extends Operation {
|
||||
date = moment.tz(input, inputFormat, inputTimezone);
|
||||
if (!date || date.format() === "Invalid date") throw Error;
|
||||
} catch (err) {
|
||||
return "Invalid format.\n\n" + FORMAT_EXAMPLES;
|
||||
throw new OperationError(`Invalid format.\n\n${FORMAT_EXAMPLES}`);
|
||||
}
|
||||
|
||||
return date.tz(outputTimezone).format(outputFormat);
|
||||
|
||||
Reference in New Issue
Block a user