We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
react_template や redux_template の中で、fetch メソッドが使われていますが、catch メソッドを使ったエラーハンドリングが必要だと思います。
catch
現状の
fetch(CrudSampleRootUrl + 'SelectCount', {method, headers, body}) .then(response => response.json()) .then(data => { if(data.Message) { this.setState({ message : data.Message }); } else if(data.ErrorMSG) { this.setState({ message : JSON.stringify(data.ErrorMSG) }); } else if(data.ExceptionMSG) { this.setState({ message : JSON.stringify(data.ExceptionMSG) }); } });
では、バックエンド・サーバーから、レスポンスとして何かしらのエラーメッセージが返された場合はそのメッセージが表示されますが、HTTP 404 エラーなど、バックエンド・サーバーに到達できなかった場合は、何もエラーメッセージが表示されません。
The text was updated successfully, but these errors were encountered:
@yusukemaegawa 以下を参考に修正しました。 JakeChampion/fetch#155 (comment)
Sorry, something went wrong.
No branches or pull requests
react_template や redux_template の中で、fetch メソッドが使われていますが、
catch
メソッドを使ったエラーハンドリングが必要だと思います。現状の
では、バックエンド・サーバーから、レスポンスとして何かしらのエラーメッセージが返された場合はそのメッセージが表示されますが、HTTP 404 エラーなど、バックエンド・サーバーに到達できなかった場合は、何もエラーメッセージが表示されません。
The text was updated successfully, but these errors were encountered: