Fixed server-side error handling
Use proper error class, avoid false positives