mirror of
https://github.com/SecurityBrewery/catalyst.git
synced 2026-11-16 02:59:47 +01:00
chore: extract handleError function (#1078)
This commit is contained in:
1 parent
a700791f43
commit
00b7ab585c
20 files changed
+46
-146
No files matched your search
@@ -1,3 +1,5 @@
|
||||
import { toast } from '@/components/ui/toast'
|
||||
|
||||
import { type ClassValue, clsx } from 'clsx'
|
||||
import { twMerge } from 'tailwind-merge'
|
||||
|
||||
@@ -12,3 +14,11 @@ export function human(bytes: number) {
|
||||
? (bytes / 1024).toFixed(1) + ' KB'
|
||||
: (bytes / 1048576).toFixed(1) + ' MB'
|
||||
}
|
||||
|
||||
export function handleError(error: Error) {
|
||||
toast({
|
||||
title: error.name,
|
||||
description: error.message,
|
||||
variant: 'destructive'
|
||||
})
|
||||
}
|
||||
Reference in new issue
Block a user