Skip to content
This repository has been archived by the owner on Apr 28, 2021. It is now read-only.

エラーの定義化 #12

Open
okunishinishi opened this issue Aug 9, 2016 · 1 comment
Open

エラーの定義化 #12

okunishinishi opened this issue Aug 9, 2016 · 1 comment

Comments

@okunishinishi
Copy link
Contributor

Callerからの呼び出しで何か失敗した時、

  • Actor側での例外
  • Netowrkの問題

というのを切り分けられるように、エラーの形式をちゃんと決めたい

@okunishinishi
Copy link
Contributor Author

okunishinishi commented Aug 9, 2016

SUGOS起因のエラーの時だけSG的なカスタム型にする

  if (e instanceof SGError) {
    switch(e.reason){
      case 'NETWORK_UNREACHABLE':
        console.error('cannot reach!')
        break
    }
  } else {
    // Actorがthrowしたやつそのまま
  }

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant