Skip to content

Commit 5b76265

Browse files
Aditya JoshiAditya Joshi
authored andcommitted
minor refactor
1 parent eff8734 commit 5b76265

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/main/java/io/github/lambdatest/SmartUIAppSnapshot.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,10 @@ public void start(Map<String, String> options) throws Exception{
5353
}
5454
}
5555
public void start() throws Exception{
56-
try{
57-
String envToken = System.getenv("PROJECT_TOKEN");
58-
this.projectToken = envToken;
59-
log.info("Project token set as: " + this.projectToken);
60-
} catch (Exception e){
56+
String envToken = System.getenv("PROJECT_TOKEN");
57+
this.projectToken = envToken;
58+
log.info("Project token set as: " + this.projectToken);
59+
if(Objects.isNull(this.projectToken)){
6160
log.severe(Constants.Errors.PROJECT_TOKEN_UNSET);
6261
throw new Exception("Project token is a mandatory field");
6362
}

0 commit comments

Comments
 (0)