Skip to content

Conversation

@bbakerman
Copy link
Member

This is useful for error specialisations as well addressing as #1690

I am still waiting on Kotlin experts on why this helps

@bbakerman bbakerman added this to the 14.0 milestone Jan 15, 2020
@bbakerman bbakerman requested a review from andimarek January 15, 2020 12:31
@bbakerman
Copy link
Member Author

bbakerman commented Jan 17, 2020

To use this in kotlin one would do

class MyException(message: String?, val extraProps: String) :
    GraphqlErrorException(newErrorException().message(message)) {

    override val message: String?
        get() {
            return "special code here : " + super.message
        }
}

That is this has extra properties AND if you really wanted to override the getMessage method in GraphqlError and the magic message property in Kotlin Throwable

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