Hi Box Team:
Currently when the API generates an exception, it might return JSON like this:
{
"type": "error",
"status": 409,
"code": "item_name_in_use",
"context_info": {
"conflicts": [
{
"type": "folder",
"id": "376299255639",
"sequence_id": "0",
"etag": "0",
"name": "Rec'd deed copy from Bastrop county-"
}
]
},
"help_url": "http://developers.box.com/docs/#errors",
"message": "Item with the same name already exists",
"request_id": "714r3iic3iyf6l48"
}
The exception is a BoxApiException and in order for me to handle that exception nicely, I essentially have to manually parse the Message property as it contains the JSON of the error.
Can you please enhance the exception aspect of the V10 SDK?
ideally, there should be an exception class for each error code.
For example, something like:
public class ItemNameInUseBoxApiException : BoxApiException {
public ImmutableArray<ConflictJson>? Conflicts {get; init; }
}
Hi Box Team:
Currently when the API generates an exception, it might return JSON like this:
The exception is a
BoxApiExceptionand in order for me to handle that exception nicely, I essentially have to manually parse theMessageproperty as it contains the JSON of the error.Can you please enhance the exception aspect of the V10 SDK?
ideally, there should be an exception class for each error code.
For example, something like: