xhiroga / aws-peacock-management-console

Browser Extension to show account alias and change color of AWS Management Console, even if AWS SSO.
MIT License
81 stars 7 forks source link

feat: improve YAML support #42

Closed xhiroga closed 2 years ago

xhiroga commented 2 years ago

Summary

Motivation

https://github.com/xhiroga/aws-peacock-management-console/issues/23

xhiroga commented 2 years ago

@umireon Thank you for the original PR https://github.com/xhiroga/aws-peacock-management-console/pull/41 Please review this before merging to main!

umireon commented 2 years ago

元の実装では、例外はユーザーに構文エラーの内容を表示するためにとっておいて、フロー制御には使わない方針でコードを書いていました。

この実装だとユーザーは設定をYAMLで書くことを意図しているのに、エラーの内容はJSONCのパーサーのエラーになってしまい、仮にエラーの内容を表示するとしたら、ユーザーは混乱してしまうことがあるかもしれないと考えて、正規表現で分岐していました。

xhiroga commented 2 years ago

この実装だとユーザーは設定をYAMLで書くことを意図しているのに、エラーの内容はJSONCのパーサーのエラーになってしまい、仮にエラーの内容を表示するとしたら、ユーザーは混乱してしまうことがあるかもしれないと考えて、正規表現で分岐していました。

なるほど、ごもっともです。 では、エラー表示をすることがあればまた考えたく!ご考慮ありがとうございました🙏