Skip to content

Commit

Permalink
Make errors human readable & Pretiffy markdown
Browse files Browse the repository at this point in the history
  • Loading branch information
shal committed Feb 19, 2019
1 parent d9a0ec7 commit 7f82ee9
Showing 1 changed file with 91 additions and 90 deletions.
181 changes: 91 additions & 90 deletions docs/api/errors.md
@@ -1,94 +1,95 @@
# Peatio Member API errors
# Peatio Member API Errors

## Account module errors
```
account.currency.doesnt_exist Currency doesn't exist in database
account.deposit.invalid_state Deposit invalid state
account.deposit.non_integer_limit Limit you submitted could not be parsed into Integer
account.deposit.invalid_limit Limit has invalid value
account.deposit.non_positive_page Page must be positive number
account.deposit.empty_txid TXID is empty
account.deposit_address.invalid_address_format Invalid param for deposit address format
## /account

account.deposit_address.doesnt_support_cash_address_format Currency doesn't support cash address format
account.withdraw.non_integer_limit Limit Value you send could not be parsed into Integer type
account.withdraw.invalid_limit Invalid limit
account.withdraw.non_positive_page Page value must be positive
account.withdraw.non_integer_otp Otp value could not be parsed into Integer type
account.withdraw.empty_otp Otp is missing, otp is empty
account.withdraw.empty_rid Rid is missing, rid is empty
account.withdraw.non_decimal_amount Amount value you send could not be parsed into Decimal type
account.withdraw.non_positive_amount Amount value must be positive
account.currency.doesnt_exist Currency doesn't exist
account.deposit.not_permitted Please, pass the corresponding verification steps to deposit funds
account.withdraw.not_permitted Please, pass the corresponding verification steps to withdraw funds
account.withdraw.insufficient_balance Account balance is insufficient
account.withdraw.invalid_amount Invalid withdraw amount
account.withdraw.create_error Failed to create withdraw
account.withdraw.invalid_otp Invalid otp
account.withdraw.disabled_api Withdrawal API is disabled
```
| Code | Description |
| --------------------------------------- | ---------------------------------------------- |
| `account.currency.doesnt_exist` | **Currency** doesn't exist in database |
| `account.deposit.invalid_state` | Deposit **state** is not valid |
| `account.deposit.non_integer_limit` | Parameter **limit** should be integer type |
| `account.deposit.invalid_limit` | Parameter **limit** is not valid |
| `account.deposit.non_positive_page` | Parameter **page** should be positive number |
| `account.deposit.empty_txid` | Parameter **txid** is missing or empty |
| `account.withdraw.non_integer_limit` | Parameter **limit** should be integer type |
| `account.withdraw.invalid_limit` | Parameter **limit** is not valid |
| `account.withdraw.non_positive_page` | Parameter **page** should be positive number |
| `account.withdraw.non_integer_otp` | Parameter **otp** should be integer type |
| `account.withdraw.empty_otp` | Parameter **otp** is missing or empty |
| `account.withdraw.empty_rid` | Parameter **rid** is missing or empty |
| `account.withdraw.non_decimal_amount` | Parameter **amount** should be decimal type |
| `account.withdraw.non_positive_amount` | Parameter **amount** should be positive number |
| `account.withdraw.insufficient_balance` | Account balance is insufficient |
| `account.withdraw.invalid_amount` | Parameter **amount** is not valid |
| `account.withdraw.create_error` | Failed to create withdraw |
| `account.withdraw.invalid_otp` | Parameter **otp** is not valid |
| `account.withdraw.disabled_api` | Withdrawal API is disabled |
| `account.deposit.not_permitted` | Pass the corresponding verification steps to **deposit funds** |
| `account.withdraw.not_permitted` | Pass the corresponding verification steps to **withdraw funds** |
| `account.deposit_address.invalid_address_format` | Invalid parameter for deposit address format |
| `account.deposit_address.doesnt_support_cash_address_format` | Currency doesn't support cash address format |

/market
```
market.market.doesnt_exist Market doesn't exist
market.order.invalid_state Invalid deposit state
market.order.invalid_limit Invalid limit
market.order.non_integer_limit Limit value you send could not be parsed into Integer type
market.trade.empty_page Page is missing or empty
market.order.invalid_order_by Invalid order_by
market.order.invalid_side Invalid order side
market.order.non_decimal_volume Volume value you send could not be parsed into Decimal type
market.order.non_positive_volume Volume value must be positive
market.order.invalid_type Invalid order type
market.order.non_decimal_price Volume value you send could not be parsed into Decimal type
market.order.non_positive_price Volume value must be positive
market.order.non_integer_id Id value you send could not be parsed into Integer type
market.order.empty_id Id is missing or empty
market.trade.non_integer_limit Limit value you send could not be parsed into Integer type
market.trade.invalid_limit Invalid limit
market.trade.empty_page Page is missing or empty
market.trade.non_integer_timestamp Timestamp value you send could not be parsed into Integer type
market.trade.empty_timestamp Timestamp is missing or empty
market.trade.invalid_order_by Invalid order_by
market.order.insufficient_market_liquidity Isufficient market liquidity
market.order.invalid_volume_or_price Invalid volume or price
market.order.create_error Failed to create error
market.order.cancel_error Failed to cancel error
market.order.market_order_price Market order doesn't have price
market.trade.not_permitted Please, pass the corresponding verification steps to enable trading
market.account.insufficient_balance Account balance is insufficient
```
## /market

/public
```
public.currency.doesnt_exist Currency doesn't exist
public.currency.invalid_type Invalid currency type
public.market.doesnt_exist Market doesn't exist
public.order_book.non_integer_ask_limit Ask limit value you send could not be parsed into Integer type
public.order_book.invalid_ask_limit Invlalid ask limit
public.order_book.non_integer_bid_limit Bid limir value you send could not be parsed into Integer type
public.order_book.invalid_bid_limit Invalid bid limit
public.trade.non_integer_limit Limit value you send could not be parsed into Integer type
public.trade.invalid_limit Invalid limit
public.trade.non_integer_limit Limit value you send could not be parsed into Integer type
public.trade.non_positive_page Page value must be positive
public.trade.non_integer_timestamp Timestamp value you send could not be parsed into Integer type
public.trade.invalid_order_by Invalid order by
public.market_depth.non_integer_limit Limit value you send could not be parsed into Integer type
public.market_depth.invalid_limit Invalid limit
public.k_line.non_integer_period Limit value you send could not be parsed into Integer type
public.k_line.invalid_period Invalid period
public.k_line.non_integer_time_from Limit value you send could not be parsed into Integer type
public.k_line.empty_time_from Time_from param is missing or empty
public.k_line.non_integer_time_to Limit value you send could not be parsed into Integer type
public.k_line.empty_time_to Time_to param is missing or empty
public.k_line.non_integer_limit Limit value you send could not be parsed into Integer type
public.k_line.invalid_limit Invalid limit
```
auth
```
jwt.decode_and_verify Couldn't decode and verify jwt
record.not_found Record not found
server.internal_error Internal Server Error
```
| Code | Description |
| -------------------------------------------- | ---------------------------------------------- |
| `market.account.insufficient_balance` | Account balance is insufficient |
| `market.market.doesnt_exist` | **Market** doesn't exist in database |
| `market.order.insufficient_market_liquidity` | Isufficient market liquidity |
| `market.order.invalid_volume_or_price` | Invalid order **volume** or **price** |
| `market.order.create_error` | Failed to create order |
| `market.order.cancel_error` | Failed to cancel order |
| `market.order.market_order_price` | Market order doesn't have **price** |
| `market.order.invalid_state` | Parameter **state** is not valid |
| `market.order.invalid_limit` | Parameter **limit** is not valid |
| `market.order.non_integer_limit` | Parameter **limit** should be integer type |
| `market.order.invalid_order_by` | Parameter **order_by** is not valid |
| `market.order.invalid_side` | Parameter **side** is not valid |
| `market.order.non_decimal_volume` | Parameter **volume** should be decimal type |
| `market.order.non_positive_volume` | Parameter **volume** should be positive number |
| `market.order.invalid_type` | Parameter **type** is not valid |
| `market.order.non_decimal_price` | Parameter **price** should be decimal type |
| `market.order.non_positive_price` | Parameter **price** should be positive number |
| `market.order.non_integer_id` | Parameter **id** should be integer type |
| `market.order.empty_id` | Parameter **id** is missing or empty |
| `market.trade.non_integer_limit` | Parameter **limit** should be integer type |
| `market.trade.invalid_limit` | Parameter **limit** is not valid |
| `market.trade.empty_page` | Parameter **page** is missing or empty |
| `market.trade.non_integer_timestamp` | Parameter **timestamp** should be integer type |
| `market.trade.empty_timestamp` | Parameter **timestamp** is missing or empty |
| `market.trade.invalid_order_by` | Parameter **order_by** is not valid |
| `market.trade.not_permitted` | Pass the corresponding verification steps to **enable trading** |

## /public

| Code | Description |
| ----------------------------------------- | ------------------------------------------------------- |
| `public.currency.doesnt_exist` | **Currency** doesn't exist in database |
| `public.currency.invalid_type` | **Currency** type is not valid |
| `public.market.doesnt_exist` | **Market** doesn't exist in database |
| `public.order_book.non_integer_ask_limit` | Parameter **ask_limit** should be valud of integer type |
| `public.order_book.invalid_ask_limit` | Parameter **ask_limit** is not valid |
| `public.order_book.non_integer_bid_limit` | Parameter **bid_limit** should be valud of integer type |
| `public.order_book.invalid_bid_limit` | Parameter **bid_limit** is not valid |
| `public.trade.invalid_limit` | Parameter **limit** is not valid |
| `public.trade.non_integer_limit` | Parameter **limit** should be valud of integer type |
| `public.trade.non_positive_page` | Parameter **page** should be positive number |
| `public.trade.non_integer_timestamp` | Parameter **timestamp** should be value of integer type |
| `public.trade.invalid_order_by` | Parameter **order_by** is not valid |
| `public.market_depth.non_integer_limit` | Parameter **limit** should be value of integer type |
| `public.market_depth.invalid_limit` | Parameter **limit** is not valid |
| `public.k_line.non_integer_period` | Parameter **period** should be value of integer type |
| `public.k_line.invalid_period` | Parameter **period** is not valid |
| `public.k_line.non_integer_time_from` | Parameter **time_from** should be value of integer type |
| `public.k_line.empty_time_from` | Parameter **time_from** is missing or empty |
| `public.k_line.non_integer_time_to` | Parameter **time_to** should be value of integer type |
| `public.k_line.empty_time_to` | Parameter **time_to** is missing or empty |
| `public.k_line.non_integer_limit` | Parameter **limit** should be value of integer type |
| `public.k_line.invalid_limit` | Parameter **limit** is not valid |

## Authentication

| Code | Description |
| ----------------------- | ----------------------------------- |
| `jwt.decode_and_verify` | Impossible to decode and verify JWT |
| `record.not_found` | Record Not found |
| `server.internal_error` | Internal Server Error |

0 comments on commit 7f82ee9

Please sign in to comment.