Unwrap groovy exception to avoid deserialisation error.