DaanVandenBosch / phantasmal-world

A suite of tools for Phantasy Star Online.
https://www.phantasmal.world/
MIT License
24 stars 5 forks source link

error cleanup, alert the error #5

Closed LunarFuror closed 4 years ago

LunarFuror commented 4 years ago

Clean up the error to break out of sequence when we encounter an error for efficiency. Then for now use alert to show the user an error of some kind. This is temporary until I can style some kind of new module for errors.

DaanVandenBosch commented 4 years ago

Putting UI code in the logger seems like a bad idea to me. Also, the way you've done it means the messages won't get logged to the console.

I forgot about this, but the model viewer actually has a way of dealing with errors/issues. It uses a ResultDialog. Take a look at ModelToolBarView and ModelToolBarController for its usage. Seems best to just reuse that here.

And please follow the code style conventions (snake_case for everything except type names).

LunarFuror commented 4 years ago

@DaanVandenBosch I agree, I was going to write a simple global module to call not necessarily put the UI code in this file, but I probably should have asked about some kind of thing already existing. The other reason to put the call here is to keep the code dry, but looking at that dialog it looks pretty tied to the view?

DaanVandenBosch commented 4 years ago

Well, I think it's best to keep logging (which is meant for aiding devs while debugging) and reporting of issues/problems to the user separate. So to me it makes sense that ResultDialog is tied to the view.

LunarFuror commented 4 years ago

Oh ok that makes sense then yes.