improved
[2022-11-16][V1] Updated error message for invalid order response
about 2 years ago by Perry
INFORMATION
Before this change, when you send an invalid order to the create order endpoint, you receive an error message with a 400 status code.
Starting from November 16, we improved the error message to be more clear and consistent.
You are not impacted by this change unless you're doing some logic checking the error message of the response.
Details
The updated error message format is Invalid order payload {ERROR_CODE_STRING}.
.
Possible ERROR_CODE_STRING
s can be found here: https://github.com/LooksRare/looksrare-sdk/blob/master/src/types/enum.ts#L12-L40
Example
When you try to list your NFT without approving the LR exchange to sell it, you were receiving this error:
{
"success": false,
"data": null,
"name": "BadRequestError",
"message": "Signer did not approve to sell tokens"
}
From today, you will receive this error instead. (See the message change)
{
"success": false,
"data": null,
"name": "BadRequestError",
"message": "Invalid order payload (ERC721_NO_APPROVAL_FOR_ALL_OR_TOKEN_ID)."
}