Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

distinguish between auth network & server errors#82

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
argemiront merged 1 commit intomasterfromfix/auth-error
Jan 25, 2020
Merged
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 19 additions & 10 deletionsweb-app/src/services/state/actions/api.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -32,19 +32,28 @@ export default {
})
.catch(error => {
onError(error)
console.error('ERROR: Authentication failed')
console.error(error)
console.log('ERROR: Authentication failed')
console.log(error.message)
let message
if (error.message.match(/Network error:/)) {
message = {
title: 'Network Error',
description: 'Make sure you have an Internet connection. Restart and try again',
}
} else {
message = {
title: 'Server Error',
description: error.message,
}
}
channel.receive({ data: { type: 'ERROR', payload: { error: message } } })
return
})

if (!result || !result.data) {
// TODO handle failed authentication
console.error('ERROR: Connection')
const error = {
title: 'Connection Failed',
description:
'Either our server is having issues or you may not be connected to the internet. Try checking your connection and restarting the application. ',
}
channel.receive({ data: { type: 'ERROR', payload: { error } } })
const error = new Error('Authentication request responded with no data')
console.log(error)
onError(error)
return
}
const { token } = result.data.editorLogin
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp