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

The application closes immediately if mkxp.json is malformed #116

Open
Eblo opened this issue Nov 2, 2023 · 3 comments
Open

The application closes immediately if mkxp.json is malformed #116

Eblo opened this issue Nov 2, 2023 · 3 comments

Comments

@Eblo
Copy link

Eblo commented Nov 2, 2023

If mkxp-z reads in an mkxp.json file with malformed JSON, it will close immediately with no information reported whatsoever. It would be preferable to handle this gracefully and report the error to the user in some way.

@Splendide-Imaginarius
Copy link

Hmm, so I think we already do this?

mkxp-z/src/config.cpp

Lines 111 to 116 in 52c932b

catch (const std::exception &e) {
Debug() << "Failed to parse" << path << ":" << e.what();
}
catch (const Exception &e) {
Debug() << "Failed to parse" << path << ":" << "Unknown encoding";
}

I wouldn't mind an error popup rather than the stderr logging that we do now though.

@Eblo
Copy link
Author

Eblo commented Nov 2, 2023

It looks like cmd in Windows just doesn't care to report an application's output. Running the game from MSYS2 does in fact produce that output. I would like to see more detail in the error, at the very least the line number of the problem encountered.

@Splendide-Imaginarius
Copy link

It looks like cmd in Windows just doesn't care to report an application's output. Running the game from MSYS2 does in fact produce that output. I would like to see more detail in the error, at the very least the line number of the problem encountered.

I think cmd is sort-of deprecated in Windows anyway in favor of PowerShell, and I think PowerShell does display that output. That said, expecting people to run mkxp-z from a command-line of any kind just to see why it's exiting as soon as it starts seems unreasonable, so yeah, let's do an error popup.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants