Skip to content

Change panics when parsing a malformed dmi to return a Result instead#319

Merged
SpaceManiac merged 2 commits intoSpaceManiac:masterfrom
moxian:dmi-result
May 18, 2022
Merged

Change panics when parsing a malformed dmi to return a Result instead#319
SpaceManiac merged 2 commits intoSpaceManiac:masterfrom
moxian:dmi-result

Conversation

@moxian
Copy link
Copy Markdown
Contributor

@moxian moxian commented May 15, 2022

Currently parsing a malformed - but also well-formed, yet ancient - .dmi files results in a panic deep within the guts of SapacemanDMM. That's undesirable, since .dmi's which SpacemanDMM does not understand (yet BYOND dreammaker handles fine) do exist in the wild (see ParadiseSS13/Paradise#17800 for a couple of examples).

I don't think teaching SpacemanDMM of the legacy file formats is worth it, but making it return a Result instead of outright panicking definitely is (and it's much less work than the former).

This is technically a breaking change since it changes the signature of the public dreammaker::dmi::Metadata::meta_from_str(). (But it's probably rarely used, and definitely easy to fix at the call site?..)

@SpaceManiac SpaceManiac merged commit 860d6c4 into SpaceManiac:master May 18, 2022
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

Successfully merging this pull request may close these issues.

2 participants