mirror of
https://github.com/pockethost/pockethost.git
synced 2025-03-30 15:08:30 +00:00
fix: more helpful error message when backup fails for nonexistent instance
This commit is contained in:
parent
dd33c7dce6
commit
3b227ac31f
@ -88,9 +88,16 @@ export const createBackupService = async (
|
||||
status: BackupStatus.FinishedSuccess,
|
||||
})
|
||||
} catch (e) {
|
||||
const message = (() => {
|
||||
const s = `${e}`
|
||||
if (s.match(/ENOENT/)) {
|
||||
return `Backup failed because instance has never been used. Go to the instance admin to use the instance for the first time.`
|
||||
}
|
||||
return s
|
||||
})()
|
||||
await client.updateBackup(backupRec.id, {
|
||||
status: BackupStatus.FinishedError,
|
||||
message: `${e}`,
|
||||
message,
|
||||
})
|
||||
}
|
||||
return true
|
||||
|
Loading…
x
Reference in New Issue
Block a user