Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dor-services-app errors raised need to surface more info to caller #331

Closed
ndushay opened this issue Aug 18, 2019 · 1 comment · Fixed by #335 or #338
Closed

dor-services-app errors raised need to surface more info to caller #331

ndushay opened this issue Aug 18, 2019 · 1 comment · Fixed by #335 or #338
Assignees

Comments

@ndushay
Copy link
Contributor

ndushay commented Aug 18, 2019

(related to sul-dlss/common-accessioning/issues/188)

For example, this is what the dor-services-client gets from a raised error in the app for the publish action:

"Dor::Services::Client::UnexpectedResponse: Internal Server Error: 500 ()" (see https://app.honeybadger.io/projects/52894/faults/50003137, which was thrown for bq454cj1549 going through common-accessioning)

the corresponding dor-services-app error: https://app.honeybadger.io/projects/50568/faults/49013058, which is the same as:

When I take the mods from bq454cj1549, which is

      <mods xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.loc.gov/mods/v3" version="3.6" xsi:schemaLocation="http://www.loc.gov/mods/v3 http://www.loc.gov/standards/mods/v3/mods-3-6.xsd">
        <typeOfResource/>
        <originInfo>
          <issuance/>
        </originInfo>
        <recordInfo>
          <recordIdentifier source="SIRSI">a13132918</recordIdentifier>
          <recordOrigin>Converted from MARCXML to MODS version 3.6 using MARC21slim2MODS3-6_SDR.xsl (SUL version 1 2018/06/13; LC Revision 1.118 2018/01/31)</recordOrigin>
        </recordInfo>
      </mods>

and I run that mods xml through the DublinCoreService .ng_xml method, there is more detail:

#<DublinCoreService::CrosswalkError: DublinCoreService#ng_xml produced incorrect xml (no children):
       <...ion="http://www.openarchives.org/OAI/2.0/oai_dc/ http://www.openarchives.org/OAI/2.0/oai_dc.xsd"/>
       > with backtrace:
         # ./app/services/dublin_core_service.rb:21:in `ng_xml'
         # ./spec/services/dublin_core_service_spec.rb:11:in `block (3 levels) in <top (required)>'
         # ./spec/services/dublin_core_service_spec.rb:49:in `block (4 levels) in <top (required)>'
         # ./spec/services/dublin_core_service_spec.rb:49:in `block (3 levels) in <top (required)>'

I would be great to get the specific error and its message included in the 500 error consumed by the caller.

This is probably a rails config setting or settings that can be changed (e.g. in config/application.rb):

https://guides.rubyonrails.org/v5.2/configuring.html#rails-general-configuration

config.consider_all_requests_local is a flag. If true then any error will cause detailed debugging information to be dumped in the HTTP response, and the Rails::Info controller will show the application runtime context in /rails/info/properties. true by default in development and test environments, and false in production mode. For finer-grained control, set this to false and implement local_request? in controllers to specify which requests should provide debugging information on errors.

local_request? on the object controller at a minimum, I'd say.

https://apidock.com/rails/Rails/ApplicationController/local_request%3F

@ndushay ndushay added this to Ready in Infrateam Aug-Sep 2019 via automation Aug 18, 2019
@ndushay ndushay changed the title errors raised need to get more info back to dor-services-client errors raised need to surface more info to caller Aug 18, 2019
@ndushay ndushay changed the title errors raised need to surface more info to caller dor-services-app errors raised need to surface more info to caller Aug 19, 2019
@mjgiarlo mjgiarlo moved this from Ready to In progress in Infrateam Aug-Sep 2019 Aug 22, 2019
@mjgiarlo mjgiarlo self-assigned this Aug 22, 2019
Infrateam Aug-Sep 2019 automation moved this from In progress to Done Aug 22, 2019
@mjgiarlo mjgiarlo reopened this Aug 22, 2019
Infrateam Aug-Sep 2019 automation moved this from Done to In progress Aug 22, 2019
@ndushay
Copy link
Contributor Author

ndushay commented Aug 23, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
2 participants