Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ログイン失敗時の手動入力URLがundefinedになってしまうバグを修正 #15

Merged
merged 2 commits into from
Dec 1, 2021

Conversation

tomoki-oke-LITALICO
Copy link
Contributor

@tomoki-oke-LITALICO tomoki-oke-LITALICO commented Nov 29, 2021

ログイン失敗時に表示される手動入力URLworksClient.punchingURLForPcについて、

function convertWorksClientErrorMessage(e: Error, user: string): string {
switch (true) {
case e instanceof WorksClientError:
return `<@${user}>\nログインができませんでした。${e.message}\n\`${COMMAND} config\` で認証をやり直してください\n出退勤を手動で行う場合は<${worksClient.punchingURLForPc}|こちら>`;
case e instanceof NetworkAccessError:
return `<@${user}>\nWorksに正しくアクセスできませんでした。暫くしてやり直してみてください\n出退勤を手動で行う場合は<${worksClient.punchingURLForPc}|こちら>`;
default:
return `<@${user}>\nなにか問題が発生しました。\n出退勤を手動で行う場合は<${worksClient.punchingURLForPc}|こちら>\n${e.stack}`;
}
}

中で使っているdomainプロパティがundefinedになっているようでした。

public get punchingURLForPc(): string {
return `https://${this.domain}/self-workflow/cws/srwtimerec?@DIRECT=true`;
}

WorksClientの初期化時、プロパティに同時にセットする場合は個別にアクセス修飾子を付ける必要がありそうです。
動作を確認するテストと修正を加えてみました。

  • 動作を確認するテストを追加: 826c5cd
  • アクセス修飾子の修正: 661a719

Copy link
Owner

@k2tzumi k2tzumi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@k2tzumi k2tzumi merged commit f04c89f into k2tzumi:master Dec 1, 2021
@github-actions github-actions bot mentioned this pull request Oct 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants