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

Commit382a6f8

Browse files
committed
improve error handling with title/description
1 parentfb2ae61 commit382a6f8

File tree

3 files changed

+12
-3
lines changed

3 files changed

+12
-3
lines changed

‎typings/index.d.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,14 @@ export interface Environment {
3838
token:string
3939
}
4040

41+
exportinterfaceErrorMessage{
42+
title:string
43+
description?:string
44+
}
45+
4146
exportinterfaceMachineContext{
4247
env:Environment
43-
error:string|null
48+
error:ErrorMessage|null
4449
tutorial:G.Tutorial|null
4550
position:Position
4651
progress:Progress

‎web-app/src/containers/LoadingPage.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ const LoadingPage = ({ text, context }: Props) => {
2424
if(error){
2525
return(
2626
<divstyle={styles.page}>
27-
<Messagetype="error"title={error}/>
27+
<Messagetype="error"title={error.title}description={error.description}/>
2828
</div>
2929
)
3030
}

‎web-app/src/services/state/actions/api.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,11 @@ export default {
3434
if(!result||!result.data){
3535
// TODO: handle failed authentication
3636
console.error('ERROR: Authentication failed')
37-
channel.receive({data:{type:'ERROR',payload:{error:'Authentication Failed'}}})
37+
consterror={
38+
title:'Authentication Failed',
39+
description:'You may not be connected to the internet. Connect and restart the application',
40+
}
41+
channel.receive({data:{type:'ERROR',payload:{ error}}})
3842
return
3943
}
4044
const{ token}=result.data.editorLogin

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp