Skip to content

Slim Application Error messages not being displayed #194

@zanhecht

Description

@zanhecht

If I try to open Croptool directly from the URL on an uncroppable file (e.g. using https://croptool.toolforge.org/?site=commons.wikimedia.org&title=IMAGENAME.jpg) it just opens CropTool without any error being displayed. The browser console does contain:

angular.js:12701 
GET https://croptool.toolforge.org/api/file/info?page=&site=commons.wikimedia.org&title=IMAGENAME.jpg 500 (Internal Server Error)

Pasting IMAGENAME.jpg in and clicking "Open" will either produce the message File «IMAGENAME.jpg» not found on «commons.wikimedia.org». or File «IMAGENAME.jpg» found on «commons.wikimedia.org». However, if the error is something else, such as "This file is currently waiting for license review", it will just display the green found text without actually opening the editor or displaying any sort of error message. Again, the console with show a 500 (Internal Server Error), and opening the URL in the console displays a "Slim Application Error" page that does correctly display the error:

Slim Application Error
The application could not run because of the following error:

Details
Type: RuntimeException
Code: 0
Message: This file is currently waiting for license review. Please wait until the review has been completed before cropping the file, since cropped files cannot be auto-reviewed by the FlickreviewR bot.
File: /workspace/src/php/WikiPage.php
Line: 92

I assume this is due to a difference in how Slim handles error messages after @sohomdatta1 migrated the code from Slim 3 to Slim 4.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions