Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
communications-backbone communications-backbone
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 25
    • Issues 25
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge requests 1
    • Merge requests 1
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Operations
    • Operations
    • Metrics
    • Incidents
    • Environments
  • Packages & Registries
    • Packages & Registries
    • Package Registry
  • Analytics
    • Analytics
    • CI/CD
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Communications Backbone System
  • communications-backbonecommunications-backbone
  • Issues
  • #32

Closed
Open
Created Feb 22, 2023 by Dan Jones@danjonOwner

Improve error messaging on 400

We were debugging a 400 error which was caused by a trailing comma in the post body. Was hard to spot and the error message was really opaque. Would be nice to catch this and return an error saying the body was invalid JSON.

def post(self):
        args = request.get_json()
        errors = self.schema.validate(args)
        if errors:
            abort(400, message=str(errors))

I assume it's actually aborting 400 at the args = request.get_json() line so it would need a try/except around there in each endpoint

Assignee
Assign to
SoAR-2023W09
Milestone
SoAR-2023W09 (Past due)
Assign milestone
Time tracking