Skip to content

Commit

Permalink
fix(core): proper exception for invalid RunContext uri
Browse files Browse the repository at this point in the history
  • Loading branch information
tchiotludo committed Sep 15, 2023
1 parent d5f9b8d commit b9b24e6
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion core/src/main/java/io/kestra/core/runners/RunContext.java
Original file line number Diff line number Diff line change
Expand Up @@ -452,11 +452,19 @@ public org.slf4j.Logger logger() {
}

public InputStream uriToInputStream(URI uri) throws IOException {
if (uri == null) {
throw new IllegalArgumentException("Invalid internal storage uri, got null");
}

if (uri.getScheme() == null) {
throw new IllegalArgumentException("Invalid internal storage uri, got uri '" + uri + "'");
}

if (uri.getScheme().equals("kestra")) {
return this.storageInterface.get(uri);
}

throw new IllegalArgumentException("Invalid scheme for uri '" + uri + "'");
throw new IllegalArgumentException("Invalid internal storage scheme, got uri '" + uri + "'");
}

/**
Expand Down

0 comments on commit b9b24e6

Please sign in to comment.