MRI: improve error printing #25

Merged
cremno merged 2 commits from mri-improve-error-printing into master 2014-04-16 18:22:58 +00:00
cremno commented 2014-04-13 22:28:47 +00:00 (Migrated from github.com)

Debug() is CRuby-style and showMsg is RGSS-style. The Debug() output is safe, showMsg might be fragile.

I think the RGSS-style error report is safe as long as #backtrace isn't modified in a weird way. Then it could crash. But CRuby/MRI also crashes in some cases.

Should I make the code more defensive?

`Debug()` is CRuby-style and `showMsg` is RGSS-style. The `Debug()` output is safe, `showMsg` might be fragile. I think the RGSS-style error report is safe as long as `#backtrace` isn't modified in a weird way. Then it could crash. But CRuby/MRI also crashes in some cases. Should I make the code more defensive?
cremno commented 2014-04-13 22:39:14 +00:00 (Migrated from github.com)

Actually the Debug() part can also crash. The question applies here as well.

Actually the `Debug()` part can also crash. The question applies here as well.
Ancurio commented 2014-04-14 07:38:02 +00:00 (Migrated from github.com)

Can you provide me with a small example that would crash any of the output paths?

Can you provide me with a small example that would crash any of the output paths?
Ancurio commented 2014-04-15 10:12:42 +00:00 (Migrated from github.com)

Actually, there's heaps of other ways to crash mkxp (eg. an intentionally malformed Scripts.rxdata), so I think the code is fine as it is for now (and modifying #backtrace seems sufficiently obscure).

Actually, there's heaps of other ways to crash mkxp (eg. an intentionally malformed Scripts.rxdata), so I think the code is fine as it is for now (and modifying #backtrace seems sufficiently obscure).
cremno commented 2014-04-16 18:16:06 +00:00 (Migrated from github.com)

Not returning an array would cause a crash. An example can't be simpler than this.

class Exception; def backtrace; end; end; raise

Writing similar code in Ruby instead of C++ would be a safer alternative. But if you're okay with it, then so be it.

Not returning an array would cause a crash. An example can't be simpler than this. ``` ruby class Exception; def backtrace; end; end; raise ``` Writing similar code in Ruby instead of C++ would be a safer alternative. But if you're okay with it, then so be it.
Ancurio commented 2014-04-16 18:22:53 +00:00 (Migrated from github.com)

Thanks. Error reporting shaping up to look pretty awesome!

Thanks. Error reporting shaping up to look pretty awesome!
Ancurio commented 2014-04-17 06:12:11 +00:00 (Migrated from github.com)

You might consider adding your name+email to the copyright header for files you've worked on.

You might consider adding your name+email to the copyright header for files you've worked on.
Sign in to join this conversation.
No reviewers
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: MapleShrine/mkxp#25
No description provided.