mirror of
https://github.com/pocketbase/pocketbase.git
synced 2026-11-11 06:17:57 +01:00
[#6102] fixed JSVM exception -> Go error unwrapping
This commit is contained in:
1 parent
4f35fb74c8
commit
3098c2dcd8
33 files changed
+119
-60
No files matched your search
+1
-15
@@ -326,21 +326,7 @@ func (p *plugin) normalizeServeExceptions(e *core.RequestEvent) error {
|
||||
return err // no error or already committed
|
||||
}
|
||||
|
||||
jsException, ok := err.(*goja.Exception)
|
||||
if !ok {
|
||||
return err // no exception
|
||||
}
|
||||
|
||||
switch v := jsException.Value().Export().(type) {
|
||||
case error:
|
||||
err = v
|
||||
case map[string]any: // goja.GoError
|
||||
if vErr, ok := v["value"].(error); ok {
|
||||
err = vErr
|
||||
}
|
||||
}
|
||||
|
||||
return err
|
||||
return normalizeException(err)
|
||||
}
|
||||
|
||||
// watchHooks initializes a hooks file watcher that will restart the
|
||||
|
||||
Reference in new issue
Block a user