Show friendly error for bad MARC start position

Bug #595371 reported by Anand Chitipothu
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Open Library
In Progress
Medium
Edward Betts

Bug Description

/show-marc is raising internal errors when the MARC content is invalid. It should rather display an error message or 404.

http://openlibrary.org/show-marc/childrensrhymesc00ford_meta.mrc:0:1192

It should also handle the bad ranges. For example, http://openlibrary.org/show-marc/marc_records_scriblio_net/part29.dat:7383350:445 works fine. But If I change the length to 443, it fails with internal error. I think it should say "404 Not Found".

Tags: marc
Changed in openlibrary:
assignee: nobody → Edward Betts (edwardbetts)
milestone: none → general-bucket
importance: Undecided → High
Changed in openlibrary:
status: New → In Progress
tags: added: marc
Revision history for this message
Edward Betts (edwardbetts) wrote :

I added a workaround for this example:

http://openlibrary.org/show-marc/childrensrhymesc00ford_meta.mrc:0:1192

It now redirects to here:

http://openlibrary.org/show-records/ia:childrensrhymesc00ford

See the code for full details.

Revision history for this message
George (george-archive) wrote :

Another e.g. http://openlibrary.org/show-records/marc_university_of_toronto/uoft.marc:160210883:1130

/upstream/templates/showmarc.tmpl: error in processing template: IndexError: string index out of range (falling back to default template)
/opt/openlibrary/production/openlibrary/plugins/upstream/templates/showmarc.html: error in processing template: IndexError: string index out of range (falling back to default template)

Revision history for this message
Edward Betts (edwardbetts) wrote :

I'm not seeing an error with that University of Toronto link.

Changed in openlibrary:
importance: High → Medium
Changed in openlibrary:
status: In Progress → Fix Committed
Revision history for this message
Edward Betts (edwardbetts) wrote :

Changing the length doesn't through an error anymore. I need to produce a nicer error when you pass an invalid start position.

Changed in openlibrary:
status: Fix Committed → In Progress
summary: - fix show-marc errors
+ Show friendly error for bad MARC start position
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.