npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@chuxingpay/errors

v1.2.0

Published

付迅错误码 ========

Downloads

8

Readme

付迅错误码

安装

npm i @chuxingpay/errors

使用

import {
  TokenException,
  FxHttpException,
  FxResponseCode,
  HcHttpException
} from '@chuxingpay/errors';

// 抛已定义的异常
throw new TokenException()
=> { message: 'token 不合法' }

// throw error with fx code
throw new FxHttpException(FxResponseCode.INSUFFICIENT_ROOM)
=> { message: '房态不足', code }

// throw error with extra msg
throw new ParamException('paramKey')
=> { message: '参数有误: paramKey', code }

=> { code: exception.getCode(), message: exception.locale(lang).getMessage() }

// 连接器错误
throw new HcHttpException(
  FxResponseCode.HC_*, // 错误码
  HC_Resp_Code, // CRS 返回码
  HC_Resp_Msg // CRS 返回信息
)

Fuxun Response Codes

| Key | Code | Desc| | :---- | :---- | :----| | INVALID_SESSION | 40000 |会话过期| | INVALID_TOKEN | | token 不合法| | INVALID_USER_OR_PWD | |用户名或密码不正确| | INVALID_PARAM | |参数错误| | NOT_FOUND ||资源不存在| | IMPORT_FAIL||导入失败| | API_NOT_FOUND||接口不存在| | INVALID_PWD||密码错误| | HOTEL_SIGNED||酒店已签约| | HOTEL_NO_ADMIN ||酒店未设置管理员| | RESERVATION_PAID||订单已支付| | ACTION_NOT_ALLOW||操作不允许| | INVOICE_POSTED||发票已开| | COLLECT_ACCOUNT_NO_VERIFY||收款账户未通过认证| | COLLECT_ACCOUNT_READONLY||收款账户目前不支持编辑| | COLLECT_ACCOUNT_INVALID_VERIFY_FEE||验证金额有误| | USER_EXIST||用户已存在| | USER_IS_BLOCKED||用户被禁用| | PBAC_ERROR||soa-pbac 服务调用错误| | PERMISSION_DENY ||权限不足| | APP_AUTH_FAIL||无效的 App secret| | NO_ROOM||房间已订满| | HOTEL_NO_SIGNED||酒店未签约| | HOTEL_NOT_ONLINE||酒店未上线| | PAY_ERROR||请款失败| | INVALID_ACCOUNT_TYPE||账户类型有误| | HOTEL_COLLECT_ACCOUNT_UNAVAILABLE||当前酒店收款账号不可用| | RESERVATION_FAIL||预定失败| | BOOKING_DENY||当前用户不能预定酒店| | INSUFFICIENT_SURPLUS||账户余额不足| | UNBOUND_PHONE|40031|用户未绑定手机号| | TOO_MANY_REQUESTS||请求数量超出限制| | CANCEL_FAIL||取消失败| | PERMISSION_DENY_V2||权限不足(v2)| | PRICE_CHANGED||房价变化| | INSUFFICIENT_ROOM||房态不足|

Fuxun HotelConnector Response Codes

| Key | Code | Desc| | :---- | :---- | :----| | HC_CREATE_ORDER| 41010|订单创建失败| | HC_QUERY_ORDER ||订单查询失败| | HC_GET_RATE_TYPE||协议价格信息查询失败| | HC_CANCEL_ORDER||订单取消失败| | HC_SDK_ROOM_STATE_NOT_FOUND | 40015|SDK房态查询失败| | HC_SDK_RATE_PRICE_NOT_FOUND||SDK房价查询失败|