Today, we are excited to announce the improvements in error responses that you receive for skill development related operations in the CLI and SMAPI; error responses for failed operations of create skill, build model, deploy skill, update skill, publish skill etc. Error responses are now more standard in metadata, more detailed, and more actionable, saving you time in debugging.
Earlier, error messages contained disparate metadata which led to inconsistency across various failed operations that you performed. Error responses are now standardized around three mandatory keys - code, message, and validationDetails. The validationDetails is further broken down into more keys such as originalInstance, allowedDataTypes, and more. With these changes errors are more structured, consistent and understandable. Below is a before and after an error code related to an invalid data type in skill manifest's publishing information:
Before
{
"error": {
"message": "Invalid data type in skill manifest."
}
}
After
{
"error": {
"code": "INVALID_DATA_TYPE",
"message": "Instance at property path\ "$.manifest.publishingInformation.distributionCountries\" of type \"string\" does not match any allowed primitive types [\"array\"].",
"validationDetails": {
"originalInstance": {
"propertyPath": "$.manifest.publishingInformation.distributionCountries",
"dataType": "string"
},
"allowedDataTypes": [
"array"
]
}
}
}
The new error code structure is live on the CLI and SMAPI today. In order to further understand the new error code structure, read up about it in our docs.