Skip to content

Commit

Permalink
use a basic if statement instead of preconditions
Browse files Browse the repository at this point in the history
  • Loading branch information
ssalinas committed Nov 10, 2015
1 parent 6ff5b2d commit a8485b6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
Original file line number Original file line Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.hubspot.singularity.runner.base.config; package com.hubspot.singularity.runner.base.config;


public class MissingConfigException extends IllegalStateException { public class MissingConfigException extends IllegalStateException {
public MissingConfigException(Exception e) { public MissingConfigException(String message) {
super(e); super(message);
} }
} }
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -127,11 +127,11 @@ private void readInitialFiles() throws IOException {


@Override @Override
public void startAndWait() { public void startAndWait() {
try { if (!configuration.getS3AccessKey().or(s3Configuration.getS3AccessKey()).isPresent()) {
Preconditions.checkState(configuration.getS3AccessKey().or(s3Configuration.getS3AccessKey()).isPresent(), "s3AccessKey not set in any s3 configs!"); throw new MissingConfigException("s3AccessKey not set in any s3 configs!");
Preconditions.checkState(configuration.getS3SecretKey().or(s3Configuration.getS3SecretKey()).isPresent(), "s3SecretKey not set in any s3 configs!"); }
} catch (IllegalStateException ise) { if (!configuration.getS3SecretKey().or(s3Configuration.getS3SecretKey()).isPresent()) {
throw new MissingConfigException(ise); throw new MissingConfigException("s3SecretKey not set in any s3 configs!");
} }


try { try {
Expand Down

0 comments on commit a8485b6

Please sign in to comment.