File tree Expand file tree Collapse file tree 1 file changed +8
-11
lines changed
Expand file tree Collapse file tree 1 file changed +8
-11
lines changed Original file line number Diff line number Diff line change 11import * as Notifications from "./elements/notifications" ;
22import { ZodSchema , z } from "zod" ;
3+ import { captureException } from "./sentry" ;
34
45// function isConfigKeyValid(name: string): boolean {
56// if (name === null || name === undefined || name === "") return false;
@@ -12,19 +13,15 @@ export function invalid(
1213 val : unknown ,
1314 customMessage ?: string
1415) : void {
15- if ( customMessage === undefined ) {
16- Notifications . add (
17- `Invalid value for ${ key } (${ val } ). Please try to change this setting again.` ,
18- - 1
19- ) ;
20- } else {
21- Notifications . add (
22- `Invalid value for ${ key } (${ val } ). ${ customMessage } ` ,
23- - 1
24- ) ;
16+ let message = `Invalid value for ${ key } (${ val } ). Please try to change this setting again.` ;
17+
18+ if ( customMessage !== undefined ) {
19+ message = `Invalid value for ${ key } (${ val } ). ${ customMessage } ` ;
2520 }
2621
27- console . error ( `Invalid value key ${ key } value ${ val } type ${ typeof val } ` ) ;
22+ Notifications . add ( message , - 1 ) ;
23+ console . error ( message ) ;
24+ captureException ( new Error ( message ) ) ;
2825}
2926
3027export function isConfigValueValid < T > (
You can’t perform that action at this time.
0 commit comments