Improves error message handler when file API calls result into an error

Jira issue: APPPARTY-59