-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
feature requestFeature requestFeature requestpkg: rest-api-client@kintone/rest-api-client@kintone/rest-api-client
Description
Package(対象パッケージ)
- @kintone/rest-api-client
Why(なぜ)
update権限がないレコードに対してupdateRecord()した場合など、
アクセス権に問題があるときは403エラーが返ってきますが、
エラーオブジェクトにerrorsもmessageもないため、エラー原因をぱっと見で確認するのが難しいです。
(エンジニアなら分かっても、一般ユーザーには分からないです。)
{
"name": "KintoneRestAPIError",
"id": "veh9IwUXQwn0wstIvhrv",
"code": "CB_NO02",
"status": 403,
"headers": {
"cache-control": "no-cache, no-store, must-revalidate",
"connection": "keep-alive",
"content-encoding": "gzip",
"content-type": "application/json;charset=utf-8",
"date": "Wed, 02 Dec 2020 02:03:51 GMT",
"server": "nginx",
"strict-transport-security": "max-age=315360000; includeSubDomains; preload;",
"transfer-encoding": "chunked",
"vary": "Accept-Encoding",
"x-concurrencylimit-limit": "100",
"x-concurrencylimit-running": "1",
"x-content-type-options": "nosniff",
"x-cybozu-error": "GAIA_BR01",
"x-frame-options": "SAMEORIGIN",
"x-ua-compatible": "IE=Edge",
"x-xss-protection": "1; mode=block"
}
}kintoneからのレスポンスに、そもそもerrors相当のものがないのだと思いますが、
せっかくSDKでラップしてもらっているので、
kintone APIエラーメッセージが気が利かない部分も吸収していただけると助かります。
エラーが起きた時、ユーザーにerrorsの内容をアラートで表示してあげることが多いので、
ユーザーに日本語でエラーを見せるには、
「403の時はアクセス権がありませんという文章を出す」みたいなロジックが必要です。
自分で実装するよりは、SDK側で対応してもらえると有り難いのです。
What(何を)
ちょっとした日本語で良いので、
code, statusに対応するメッセージが出ると良いですね。
アクセス権以外にもメッセージ無しのエラーはあるかもしれませんが、未確認です。
{
"name": "KintoneRestAPIError",
"id": "veh9IwUXQwn0wstIvhrv",
"code": "CB_NO02",
"errors": {
"message": "アクセス権がありません。"
},
"status": 403,
"headers": {
"cache-control": "no-cache, no-store, must-revalidate",
"connection": "keep-alive",
"content-encoding": "gzip",
"content-type": "application/json;charset=utf-8",
"date": "Wed, 02 Dec 2020 02:03:51 GMT",
"server": "nginx",
"strict-transport-security": "max-age=315360000; includeSubDomains; preload;",
"transfer-encoding": "chunked",
"vary": "Accept-Encoding",
"x-concurrencylimit-limit": "100",
"x-concurrencylimit-running": "1",
"x-content-type-options": "nosniff",
"x-cybozu-error": "GAIA_BR01",
"x-frame-options": "SAMEORIGIN",
"x-ua-compatible": "IE=Edge",
"x-xss-protection": "1; mode=block"
}
}Metadata
Metadata
Assignees
Labels
feature requestFeature requestFeature requestpkg: rest-api-client@kintone/rest-api-client@kintone/rest-api-client