mirror of
https://github.com/EnixCoda/Gitako.git
synced 2026-03-11 08:54:44 +00:00
fix: wait for execution
This commit is contained in:
parent
d9dafee9b8
commit
5d4f92840c
1 changed files with 4 additions and 4 deletions
|
|
@ -1,6 +1,6 @@
|
|||
import { version } from '../package.json'
|
||||
import { Middleware } from 'driver/connect.js'
|
||||
import { IN_PRODUCTION_MODE } from 'env'
|
||||
import { version } from '../package.json'
|
||||
// TODO: set this through ENV or something else
|
||||
const LOG_ENDPOINT = 'https://enix.one/gitako/log'
|
||||
|
||||
|
|
@ -10,9 +10,9 @@ export function raiseError(error: Error) {
|
|||
|
||||
export const withErrorLog: Middleware = function withErrorLog(method, args) {
|
||||
return [
|
||||
function() {
|
||||
async function() {
|
||||
try {
|
||||
method.apply(this, arguments)
|
||||
await method.apply(this, arguments)
|
||||
} catch (error) {
|
||||
raiseError(error)
|
||||
}
|
||||
|
|
@ -34,6 +34,6 @@ function reportError(error: Error) {
|
|||
error: (error && error.message) || error,
|
||||
path: window.location.href,
|
||||
version,
|
||||
})}`
|
||||
})}`,
|
||||
)
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue