mirror of
https://github.com/invoke-ai/InvokeAI.git
synced 2026-02-09 04:55:15 -05:00
feat(ui): add util to extract message from a tsafe AssertionError
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
import type { AssertionError } from 'tsafe';
|
||||
|
||||
export function extractMessageFromAssertionError(error: AssertionError): string | null {
|
||||
const match = error.message.match(/Wrong assertion encountered: "(.*)"/);
|
||||
return match ? (match[1] ?? null) : null;
|
||||
}
|
||||
Reference in New Issue
Block a user