@autional/shared 0.1.0-rc.37 → 0.1.0-rc.38
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/index.ts +1 -0
- package/src/utils/error-semantics.ts +5 -0
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -55,6 +55,11 @@ export function isNotFoundError(error: unknown): boolean {
|
|
|
55
55
|
return getHttpStatus(error) === 404;
|
|
56
56
|
}
|
|
57
57
|
|
|
58
|
+
/** HTTP 401:登录态失效(与 query-state 同口径,供调用方在语义层统一取用)。 */
|
|
59
|
+
export function isUnauthorizedError(error: unknown): boolean {
|
|
60
|
+
return getHttpStatus(error) === 401;
|
|
61
|
+
}
|
|
62
|
+
|
|
58
63
|
/** 「未开通」判定:404 且契约标记 absence='unprovisioned'。 */
|
|
59
64
|
export function isUnprovisionedError(error: unknown): boolean {
|
|
60
65
|
if (getHttpStatus(error) !== 404) return false;
|