TitleBlacklist's error message in the API has no machine-readable information that it's caused by a blacklisted title.
For example:
{
"servedby": "deployment-mediawiki01",
"error": {
"info": "TitleBlacklist prevents this title from being created",
"code": "senselessimagename",
"invalidparameter": "filename",
"filekey": "13i5i0u8vv8w.5sc2g2.1252.jpg",
"*": "See http://commons.wikimedia.beta.wmflabs.org/w/api.php for API usage",
"sessionkey": "13i5i0u8vv8w.5sc2g2.1252.jpg"
}
}The code is actually defined on-wiki in 'MediaWiki:Titleblacklist', and the info (which is meant to be a human-readable fallback when API client can't handle the code) is the only indication that TitleBlacklist was involved.
code should always be the same for TitleBlacklist-related errors, with the current code returned as some additional parameter in the response.