This repository was archived by the owner on Sep 27, 2023. It is now read-only.
Merged
Conversation
akiomik
commented
Jun 17, 2022
| } else { | ||
| console.error('未定義のエラー', e.name, e.message) | ||
| throw new Error( | ||
| `<<未定義のエラーが発生しました (${e.name}: ${e.message})。改善しない場合はGoogleアカウントのログアウトおよび再ログインをお試しください>>` |
Contributor
Author
There was a problem hiding this comment.
未定義のエラーが出た場合は再ログインを促すようにします。
akiomik
commented
Jun 17, 2022
| range.setValues(data) | ||
| } catch (e) { | ||
| throw new Error( | ||
| `<<出力中にエラーが発生しました (${e.name}: ${e.message})。改善しない場合はGoogleアカウントのログアウトおよび再ログインをお試しください>>` |
Contributor
Author
There was a problem hiding this comment.
シートに書き込むタイミングでエラーが出た場合は再ログインを促すようにします。
akiomik
commented
Jun 17, 2022
Comment on lines
+33
to
+38
| let companyService | ||
| try { | ||
| companyService = new CompanyService(ticker, client, today) | ||
| } catch (e) { | ||
| ErrorHandler.handle(e) | ||
| } |
Contributor
Author
There was a problem hiding this comment.
ここでエラーが出るとしたら HttpError だけの想定なんですが、どこでなんのエラーが出るかわからないので、未定義なエラーもハンドリングできるように ErrorHandler.handleHttpError ではなく広めに ErrorHandler.handle してます。
akiomik
commented
Jun 17, 2022
Comment on lines
+59
to
+68
| try { | ||
| quarterApiPeriods.forEach(period => { | ||
| quarters.push(client.quarter(ticker, YearQuarterParam.fromYearQuarter(period))) | ||
| }) | ||
| ondemandQuarterApiPeriods.forEach(period => { | ||
| quarters.push(client.ondemandQuarter(ticker, YearQuarterParam.fromYearQuarter(period))) | ||
| }) | ||
| } catch (e) { | ||
| ErrorHandler.handle(e) | ||
| } |
Contributor
Author
There was a problem hiding this comment.
同上です。広めに ErrorHandler.handle してます。
akiomik
commented
Jun 17, 2022
| import { ApiResponseError, OndemandApiNotEnabledError, UnsupportedTickerError } from '~/custom-functions/error' | ||
| import { InvalidLYLQError, InvalidYearError, InvalidQuarterError } from '~/fiscal-periods/error' | ||
|
|
||
| export class ErrorHandler { |
Contributor
Author
There was a problem hiding this comment.
内部用の Error を受け取って外部向けの Error を投げ返すだけのクラスです。
shoe116
approved these changes
Jun 17, 2022
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
エラーハンドリングの改善を行いました。
BCODE関数とCSV出力のエラーハンドリングを共通化したErrorHandlerを追加HttpErrorの改善BCODE
CSV