Uploaded image for project: 'BookBrainz'
  1. BookBrainz
  2. BB-339

500 error when visiting non-existing revision page

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Normal Normal
    • None
    • None
    • None

       

      Currently, visiting the revision page for a revision that does not exist (https://test.bookbrainz.org/revision/8633 for example) throws a 500 error.
      This could be improved to show a 404 instead and have helpful text.

      Logs reproduced below:

      ERROR TypeError: Cannot read property 'toJSON' of null
       at _bluebird2.default.join (/home/bookbrainz/bookbrainz-site/lib/server/routes/revision.js:249:23)
       at runCallback (timers.js:705:18)
       at tryOnImmediate (timers.js:676:5)
       at processImmediate (timers.js:658:5)
       From previous event:
       at router.get (/home/bookbrainz/bookbrainz-site/lib/server/routes/revision.js:245:21)
       at Layer.handle [as handle_request] (/home/bookbrainz/bookbrainz-site/node_modules/express/lib/router/layer.js:95:5)
       at next (/home/bookbrainz/bookbrainz-site/node_modules/express/lib/router/route.js:137:13)
       at Route.dispatch (/home/bookbrainz/bookbrainz-site/node_modules/express/lib/router/route.js:112:3)
       at Layer.handle [as handle_request] (/home/bookbrainz/bookbrainz-site/node_modules/express/lib/router/layer.js:95:5)
       at /home/bookbrainz/bookbrainz-site/node_modules/express/lib/router/index.js:281:22
       at param (/home/bookbrainz/bookbrainz-site/node_modules/express/lib/router/index.js:354:14)
       at param (/home/bookbrainz/bookbrainz-site/node_modules/express/lib/router/index.js:365:14)
       at Function.process_params (/home/bookbrainz/bookbrainz-site/node_modules/express/lib/router/index.js:410:3)
       at next (/home/bookbrainz/bookbrainz-site/node_modules/express/lib/router/index.js:275:10)
       at Function.handle (/home/bookbrainz/bookbrainz-site/node_modules/express/lib/router/index.js:174:3)
       at router (/home/bookbrainz/bookbrainz-site/node_modules/express/lib/router/index.js:47:12)
       at Layer.handle [as handle_request] (/home/bookbrainz/bookbrainz-site/node_modules/express/lib/router/layer.js:95:5)
       at trim_prefix (/home/bookbrainz/bookbrainz-site/node_modules/express/lib/router/index.js:317:13)
       at /home/bookbrainz/bookbrainz-site/node_modules/express/lib/router/index.js:284:7
       at Function.process_params (/home/bookbrainz/bookbrainz-site/node_modules/express/lib/router/index.js:335:12)
       at next (/home/bookbrainz/bookbrainz-site/node_modules/express/lib/router/index.js:275:10)
       at /home/bookbrainz/bookbrainz-site/node_modules/express/lib/router/index.js:635:15
       at next (/home/bookbrainz/bookbrainz-site/node_modules/express/lib/router/index.js:260:14)
       at Function.handle (/home/bookbrainz/bookbrainz-site/node_modules/express/lib/router/index.js:174:3)

            panwarabhishek345 Abhishek Panwar
            mr_monkey Monkey
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                Version Package