You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@trafficcontrol.apache.org by GitBox <gi...@apache.org> on 2018/12/05 17:49:29 UTC

[GitHub] jhg03a opened a new issue #3090: Improve error reporting in API

jhg03a opened a new issue #3090: Improve error reporting in API
URL: https://github.com/apache/trafficcontrol/issues/3090
 
 
   Some of our API endpoints handle database errors better than others.  We should be more consistent in this.  This is not a complete audit, but just a sample I've run across.
   
   Example:
   Most common working case:
   POST /api/1.3/divisions/kabletown/regions twice
   Response code 400
   ```
   "alerts": [
     {
       "level": "error",
       "text": "region[kabletown] already exists."
     }
   ]
   ```
   
   Inconsistent working case:
   POST /api/1.3/users twice
   Response code 400
   ```
   "alerts": [
     {
       "level": "error",
       "text": "email is already taken"
     },
     {
       "level": "error",
       "text": "username is already taken"
     }
   ]
   ```
   
   Suboptimal case:
   POST /api/1.3/cachegroups twice
   Response code 500
   ```
   {
     "alerts": [
       {
         "level": "error",
         "text": "Internal Server Error"
       }
     ]
   }
   ```

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services