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

Throw exception when finding malformed PostDoc #57

Open
grahamboree opened this issue Jan 17, 2024 · 0 comments
Open

Throw exception when finding malformed PostDoc #57

grahamboree opened this issue Jan 17, 2024 · 0 comments
Labels
🐛bug Clearly not working as expected

Comments

@grahamboree
Copy link
Contributor

Currently, a malformed PostDoc like the following will set the resulting value to null.

public class Test {
    public int value;

    // Invalid because we expect this to return a Test instance
    public void PostDoc(Test existing) {
        if (existing.value > 42) {
            throw new Exception("Value too high!");
        }
    }
}

...

DocNode Doc = ...;
Test readValue = Doc.As<Test>(); // This is always set to null

DarkConfig should throw an exception when scanning for PostDoc functions and finding one with a signature that doesn't match what it's expecting.

@grahamboree grahamboree added the 🐛bug Clearly not working as expected label Jan 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛bug Clearly not working as expected
Projects
None yet
Development

No branches or pull requests

1 participant