Throw the creation exception if there isn't a job created#3163
Throw the creation exception if there isn't a job created#3163pongad merged 1 commit intogoogleapis:masterfrom
Conversation
`getJob` returns `null` when a job wasn't actually created - e.g. when you're running a dry run query
|
I don't think this is the right thing to do. The documentation recommends checking against null to see if the job still exists. What's the motivation for this change? |
|
@pongad My motivation was dry run queries but it might be more general. Running a dry-run query job doesn't actually create a job. Without this change, a dry run query job with an invalid query just returned In a larger scope, this is in the error path for |
|
Ah you're right. And because this is in This LGTM, but @tswast should sign off. |
tswast
left a comment
There was a problem hiding this comment.
Thanks!
Since this method could already throw createException it totally makes sense to be consistent in the case of this final check.
getJobreturnsnullwhen a job wasn't actually created - e.g. when you're running a dry run query