(type: ErrorType)
| 113 | } |
| 114 | |
| 115 | function getStatusCodeByType(type: ErrorType) { |
| 116 | switch (type) { |
| 117 | case 'bad_request': |
| 118 | return 400; |
| 119 | case 'unauthorized': |
| 120 | return 401; |
| 121 | case 'forbidden': |
| 122 | return 403; |
| 123 | case 'not_found': |
| 124 | return 404; |
| 125 | case 'rate_limit': |
| 126 | return 429; |
| 127 | case 'offline': |
| 128 | return 503; |
| 129 | default: |
| 130 | return 500; |
| 131 | } |
| 132 | } |
no outgoing calls
no test coverage detected
searching dependent graphs…