Skip to content

Conversation

@adrian-wang
Copy link
Contributor

No description provided.

@SparkQA
Copy link

SparkQA commented May 27, 2015

Test build #33579 has finished for PR 6434 at commit be82259.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@srowen
Copy link
Member

srowen commented May 27, 2015

I agree that it's not good practice to throw Exception, or RuntimeException, as these are generic base classes. sys.error just causes a RuntimeException though. I think that's not a real improvement and is less clear, and sys.error isn't used in the rest of the code as a rule anyway.

Instead these should be more meaningful exception types.

@rxin
Copy link
Contributor

rxin commented May 28, 2015

@srowen do you have a better suggestion for this case? In these cases, these cases are not supposed to happen at runtime. It is almost like an assert.

@srowen
Copy link
Member

srowen commented May 28, 2015

A subclass of RuntimeException is appropriate then. I use IllegalArgumentException for something basically related to input to the method, and IllegalStateException as a more general subclass of RuntimeException. It's quite minor, but while we're here, I'd rather do what I think is the general best practice in Java-land.

@rxin
Copy link
Contributor

rxin commented May 28, 2015

+1

@rxin
Copy link
Contributor

rxin commented May 29, 2015

Sorry @adrian-wang I think in this case IllegalArgumentException is more appropriate.

@SparkQA
Copy link

SparkQA commented May 29, 2015

Test build #33706 has finished for PR 6434 at commit f8dea2d.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@rxin
Copy link
Contributor

rxin commented Jun 8, 2015

@adrian-wang can you update the exception to IllegalArgumentException so I can merge this?

@adrian-wang
Copy link
Contributor Author

Oh, sorry for missing this, I'll update it very soon.

@SparkQA
Copy link

SparkQA commented Jun 8, 2015

Test build #34428 has finished for PR 6434 at commit ee1b64f.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@SparkQA
Copy link

SparkQA commented Jun 8, 2015

Test build #34427 has finished for PR 6434 at commit f7c53e9.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@adrian-wang adrian-wang changed the title [MINOR] change new Exception to sys.err [MINOR] change new Exception to IllegalArgumentException Jun 8, 2015
@rxin
Copy link
Contributor

rxin commented Jun 8, 2015

Thanks. I've merged this.

@asfgit asfgit closed this in 49f19b9 Jun 8, 2015
nemccarthy pushed a commit to nemccarthy/spark that referenced this pull request Jun 19, 2015
Author: Daoyuan Wang <[email protected]>

Closes apache#6434 from adrian-wang/joinerr and squashes the following commits:

ee1b64f [Daoyuan Wang] break line
f7c53e9 [Daoyuan Wang] to IllegalArgumentException
f8dea2d [Daoyuan Wang] sys.err to IllegalStateException
be82259 [Daoyuan Wang] change new exception to sys.err
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.

4 participants