mirror of
https://github.com/mollersuite/monofile.git
synced 2024-11-25 15:06:26 -08:00
try fixing errmsgs
This commit is contained in:
parent
99bdc5fcef
commit
ceb4e746ec
|
@ -22,6 +22,7 @@ export default async function ServeError(
|
||||||
// serve error
|
// serve error
|
||||||
res.statusMessage = reason
|
res.statusMessage = reason
|
||||||
res.status(code)
|
res.status(code)
|
||||||
|
res.header("x-backup-status-message", reason) // glitch default nginx configuration
|
||||||
res.send(
|
res.send(
|
||||||
errorPage
|
errorPage
|
||||||
.replace(/\$code/g,code.toString())
|
.replace(/\$code/g,code.toString())
|
||||||
|
|
|
@ -44,7 +44,7 @@ export function deleteAccount(optPicker) {
|
||||||
})}).then((response) => {
|
})}).then((response) => {
|
||||||
|
|
||||||
if (response.status != 200) {
|
if (response.status != 200) {
|
||||||
optPicker.picker(`${response.status} ${response.statusText}`,[])
|
optPicker.picker(`${response.status} ${res.headers.get("x-backup-status-message") || response.statusText || ""}`,[])
|
||||||
}
|
}
|
||||||
|
|
||||||
fetchAccountData()
|
fetchAccountData()
|
||||||
|
@ -77,7 +77,7 @@ export function userChange(optPicker) {
|
||||||
})}).then((response) => {
|
})}).then((response) => {
|
||||||
|
|
||||||
if (response.status != 200) {
|
if (response.status != 200) {
|
||||||
optPicker.picker(`${response.status} ${response.statusText}`,[])
|
optPicker.picker(`${response.status} ${res.headers.get("x-backup-status-message") || response.statusText || ""}`,[])
|
||||||
}
|
}
|
||||||
|
|
||||||
fetchAccountData()
|
fetchAccountData()
|
||||||
|
@ -106,7 +106,7 @@ export function forgotPassword(optPicker) {
|
||||||
account:exp.user
|
account:exp.user
|
||||||
})}).then((response) => {
|
})}).then((response) => {
|
||||||
if (response.status != 200) {
|
if (response.status != 200) {
|
||||||
optPicker.picker(`${response.status} ${response.statusText}`,[])
|
optPicker.picker(`${response.status} ${res.headers.get("x-backup-status-message") || response.statusText || ""}`,[])
|
||||||
} else {
|
} else {
|
||||||
optPicker.picker(`Please follow the instructions sent to your inbox.`,[])
|
optPicker.picker(`Please follow the instructions sent to your inbox.`,[])
|
||||||
}
|
}
|
||||||
|
@ -135,7 +135,7 @@ export function emailChange(optPicker) {
|
||||||
email:exp.email
|
email:exp.email
|
||||||
})}).then((response) => {
|
})}).then((response) => {
|
||||||
if (response.status != 200) {
|
if (response.status != 200) {
|
||||||
optPicker.picker(`${response.status} ${response.statusText}`,[])
|
optPicker.picker(`${response.status} ${res.headers.get("x-backup-status-message") || response.statusText || ""}`,[])
|
||||||
} else {
|
} else {
|
||||||
optPicker.picker(`Please continue to your inbox at ${exp.email.split("@")[1]} and click on the attached link.`,[])
|
optPicker.picker(`Please continue to your inbox at ${exp.email.split("@")[1]} and click on the attached link.`,[])
|
||||||
}
|
}
|
||||||
|
@ -167,7 +167,7 @@ export function pwdChng(optPicker) {
|
||||||
})}).then((response) => {
|
})}).then((response) => {
|
||||||
|
|
||||||
if (response.status != 200) {
|
if (response.status != 200) {
|
||||||
optPicker.picker(`${response.status} ${response.statusText}`,[])
|
optPicker.picker(`${response.status} ${res.headers.get("x-backup-status-message") || response.statusText || ""}`,[])
|
||||||
}
|
}
|
||||||
|
|
||||||
fetchAccountData()
|
fetchAccountData()
|
||||||
|
@ -197,7 +197,7 @@ export function customcss(optPicker) {
|
||||||
})}).then((response) => {
|
})}).then((response) => {
|
||||||
|
|
||||||
if (response.status != 200) {
|
if (response.status != 200) {
|
||||||
optPicker.picker(`${response.status} ${response.statusText}`,[])
|
optPicker.picker(`${response.status} ${res.headers.get("x-backup-status-message") || response.statusText || ""}`,[])
|
||||||
}
|
}
|
||||||
|
|
||||||
fetchAccountData()
|
fetchAccountData()
|
||||||
|
@ -229,7 +229,7 @@ export function embedColor(optPicker) {
|
||||||
})}).then((response) => {
|
})}).then((response) => {
|
||||||
|
|
||||||
if (response.status != 200) {
|
if (response.status != 200) {
|
||||||
optPicker.picker(`${response.status} ${response.statusText}`,[])
|
optPicker.picker(`${response.status} ${res.headers.get("x-backup-status-message") || response.statusText || ""}`,[])
|
||||||
}
|
}
|
||||||
|
|
||||||
fetchAccountData()
|
fetchAccountData()
|
||||||
|
@ -260,7 +260,7 @@ export function embedSize(optPicker) {
|
||||||
})}).then((response) => {
|
})}).then((response) => {
|
||||||
|
|
||||||
if (response.status != 200) {
|
if (response.status != 200) {
|
||||||
optPicker.picker(`${response.status} ${response.statusText}`,[])
|
optPicker.picker(`${response.status} ${res.headers.get("x-backup-status-message") || response.statusText || ""}`,[])
|
||||||
}
|
}
|
||||||
|
|
||||||
fetchAccountData()
|
fetchAccountData()
|
||||||
|
|
|
@ -31,7 +31,7 @@ export function pwdReset(optPicker) {
|
||||||
})}).then((response) => {
|
})}).then((response) => {
|
||||||
|
|
||||||
if (response.status != 200) {
|
if (response.status != 200) {
|
||||||
optPicker.picker(`${response.status} ${response.statusText}`,[])
|
optPicker.picker(`${response.status} ${res.headers.get("x-backup-status-message") || response.statusText || ""}`,[])
|
||||||
}
|
}
|
||||||
|
|
||||||
})
|
})
|
||||||
|
@ -67,7 +67,7 @@ export function chgOwner(optPicker) {
|
||||||
})}).then((response) => {
|
})}).then((response) => {
|
||||||
|
|
||||||
if (response.status != 200) {
|
if (response.status != 200) {
|
||||||
optPicker.picker(`${response.status} ${response.statusText}`,[])
|
optPicker.picker(`${response.status} ${res.headers.get("x-backup-status-message") || response.statusText || ""}`,[])
|
||||||
}
|
}
|
||||||
|
|
||||||
})
|
})
|
||||||
|
@ -96,7 +96,7 @@ export function delFile(optPicker) {
|
||||||
})}).then((response) => {
|
})}).then((response) => {
|
||||||
|
|
||||||
if (response.status != 200) {
|
if (response.status != 200) {
|
||||||
optPicker.picker(`${response.status} ${response.statusText}`,[])
|
optPicker.picker(`${response.status} ${res.headers.get("x-backup-status-message") || response.statusText || ""}`,[])
|
||||||
}
|
}
|
||||||
|
|
||||||
})
|
})
|
||||||
|
@ -125,7 +125,7 @@ export function elevateUser(optPicker) {
|
||||||
})}).then((response) => {
|
})}).then((response) => {
|
||||||
|
|
||||||
if (response.status != 200) {
|
if (response.status != 200) {
|
||||||
optPicker.picker(`${response.status} ${response.statusText}`,[])
|
optPicker.picker(`${response.status} ${res.headers.get("x-backup-status-message") || response.statusText || ""}`,[])
|
||||||
}
|
}
|
||||||
|
|
||||||
})
|
})
|
||||||
|
@ -181,7 +181,7 @@ export function deleteAccount(optPicker) {
|
||||||
})}).then((response) => {
|
})}).then((response) => {
|
||||||
|
|
||||||
if (response.status != 200) {
|
if (response.status != 200) {
|
||||||
optPicker.picker(`${response.status} ${response.statusText}`,[])
|
optPicker.picker(`${response.status} ${res.headers.get("x-backup-status-message") || response.statusText || ""}`,[])
|
||||||
}
|
}
|
||||||
|
|
||||||
fetchAccountData()
|
fetchAccountData()
|
||||||
|
|
|
@ -59,7 +59,7 @@ export function dfv(optPicker) {
|
||||||
})}).then((response) => {
|
})}).then((response) => {
|
||||||
|
|
||||||
if (response.status != 200) {
|
if (response.status != 200) {
|
||||||
optPicker.picker(`${response.status} ${response.statusText}`,[])
|
optPicker.picker(`${response.status} ${res.headers.get("x-backup-status-message") || response.statusText || ""}`,[])
|
||||||
}
|
}
|
||||||
|
|
||||||
fetchAccountData()
|
fetchAccountData()
|
||||||
|
@ -86,7 +86,7 @@ export function update_all_files(optPicker) {
|
||||||
})}).then((response) => {
|
})}).then((response) => {
|
||||||
|
|
||||||
if (response.status != 200) {
|
if (response.status != 200) {
|
||||||
optPicker.picker(`${response.status} ${response.statusText}`,[])
|
optPicker.picker(`${response.status} ${res.headers.get("x-backup-status-message") || response.statusText || ""}`,[])
|
||||||
}
|
}
|
||||||
|
|
||||||
fetchAccountData()
|
fetchAccountData()
|
||||||
|
@ -129,7 +129,7 @@ export function fileOptions(optPicker,file) {
|
||||||
})}).then((response) => {
|
})}).then((response) => {
|
||||||
|
|
||||||
if (response.status != 200) {
|
if (response.status != 200) {
|
||||||
optPicker.picker(`${response.status} ${response.statusText}`,[])
|
optPicker.picker(`${response.status} ${res.headers.get("x-backup-status-message") || response.statusText || ""}`,[])
|
||||||
}
|
}
|
||||||
|
|
||||||
fetchFilePointers();
|
fetchFilePointers();
|
||||||
|
@ -151,7 +151,7 @@ export function fileOptions(optPicker,file) {
|
||||||
})}).then((response) => {
|
})}).then((response) => {
|
||||||
|
|
||||||
if (response.status != 200) {
|
if (response.status != 200) {
|
||||||
optPicker.picker(`${response.status} ${response.statusText}`,[])
|
optPicker.picker(`${response.status} ${res.headers.get("x-backup-status-message") || response.statusText || ""}`,[])
|
||||||
}
|
}
|
||||||
|
|
||||||
fetchFilePointers();
|
fetchFilePointers();
|
||||||
|
@ -198,7 +198,7 @@ export function fileOptions(optPicker,file) {
|
||||||
})}).then((response) => {
|
})}).then((response) => {
|
||||||
|
|
||||||
if (response.status != 200) {
|
if (response.status != 200) {
|
||||||
optPicker.picker(`${response.status} ${response.statusText}`,[])
|
optPicker.picker(`${response.status} ${res.headers.get("x-backup-status-message") || response.statusText || ""}`,[])
|
||||||
}
|
}
|
||||||
|
|
||||||
fetchFilePointers();
|
fetchFilePointers();
|
||||||
|
|
|
@ -39,7 +39,7 @@
|
||||||
authError = await res.json().catch(() => {
|
authError = await res.json().catch(() => {
|
||||||
return {
|
return {
|
||||||
status: res.status,
|
status: res.status,
|
||||||
message: res.statusText
|
message: res.headers.get("x-backup-status-message") || res.statusText || ""
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in a new issue