Skip to content

JavaScript responds incorrectly to the server returning 500 Internal Server Error error #36

Open
@FlatAssembler

Description

@FlatAssembler

Steps to reproduce:

  1. Run the PHP server in such a way that it cannot communicate with MySQL.
  2. Fire up the browser to http://localhost/
  3. Press the "Upload" button.
  4. You will get a message such as this one:

Image

So, JavaScript is behaving as if PHP returned no error message, but it is supposed to return an error message. Here is the PHP code which returns the message Connection to the database failed: https://github.com/FlatAssembler/PicoBlaze_Simulator_in_JS/blob/3e9f91810c8614db7b9a305ba5c25e58f57f1adf/db.php#L26C1-L27C75

And, indeed, the PHP server in the terminal claims to return the error 500, rather than 200 OK:

Image

And here is how JavaScript checks whether the server returned 200 OK:
https://github.com/FlatAssembler/PicoBlaze_Simulator_in_JS/blob/3e9f91810c8614db7b9a305ba5c25e58f57f1adf/sharer.js#L14C1-L22C1

I have no idea where the problem might be.

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