Only show one error at once (#2801)
* Do not show more than one error toast at a time * use sha as file upload id * again * again * again * again * fmt * Hopefully fix flakiness * move to macos-14-large --------- Co-authored-by: Paul Tagliamonte <paul@zoo.dev> Co-authored-by: Paul R. Tagliamonte <paul@kittycad.io>
This commit is contained in:
@ -29,7 +29,10 @@ export function cleanErrs<T>(
|
||||
return [argsWOutErr.length !== value.length, argsWOutErr, argsWErr]
|
||||
}
|
||||
|
||||
// Used to report errors to user at a certain point in execution
|
||||
/**
|
||||
* Used to report errors to user at a certain point in execution
|
||||
* @returns boolean
|
||||
*/
|
||||
export function trap<T>(
|
||||
value: ExcludeErr<T> | Error,
|
||||
opts?: {
|
||||
@ -43,6 +46,8 @@ export function trap<T>(
|
||||
|
||||
console.error(value)
|
||||
opts?.suppress ||
|
||||
toast.error((opts?.altErr ?? value ?? new Error('Unknown')).toString())
|
||||
toast.error((opts?.altErr ?? value ?? new Error('Unknown')).toString(), {
|
||||
id: 'error',
|
||||
})
|
||||
return true
|
||||
}
|
||||
|
Reference in New Issue
Block a user