[Koha-bugs] [Bug 31022] New: 400/404 actually returns 500

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Thu Jun 23 09:59:56 CEST 2022


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31022

            Bug ID: 31022
           Summary: 400/404 actually returns 500
 Change sponsored?: ---
           Product: Koha
           Version: unspecified
          Hardware: All
                OS: All
            Status: NEW
          Severity: major
          Priority: P5 - low
         Component: REST API
          Assignee: koha-bugs at lists.koha-community.org
          Reporter: jonathan.druart+koha at gmail.com
                CC: martin.renvoize at ptfs-europe.com, tomascohen at gmail.com

Not sure if I am missing something, but I don't manage to get a 400 with the
syntax we are using all around our REST API code.

  return $c->render(
    status  => 400,
    openapi => { error => "this is an error" }
  );

I am getting a 500 with, in Koha logs:

  [{"message":"Missing property.","path":"\/body\/errors"}] 

So yes, it is working with:

  return $c->render(
    status  => 400,
    openapi => { errors => [ {message => 'this is an error'}] }
  );

But it's not at all what we are doing in our REST API module.

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are watching all bug changes.


More information about the Koha-bugs mailing list