Skip to content

Commit

Permalink
[GR-58237] Improve the error message when NativeImageFileSystemProvid…
Browse files Browse the repository at this point in the history
…er is not present.

PullRequest: graal/18955
  • Loading branch information
jovanstevanovic committed Oct 8, 2024
2 parents c7ef68b + 085e8be commit 5cc94b9
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@

package com.oracle.svm.core.jdk.resources;

import com.oracle.svm.core.jdk.JavaNetSubstitutions;

import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
Expand Down Expand Up @@ -56,6 +54,8 @@
import java.util.concurrent.locks.ReadWriteLock;
import java.util.concurrent.locks.ReentrantReadWriteLock;

import com.oracle.svm.core.jdk.JavaNetSubstitutions;

public class NativeImageResourceFileSystemProvider extends FileSystemProvider {

private final String resourcePath = "/resources";
Expand Down Expand Up @@ -141,7 +141,8 @@ public FileSystem getFileSystem(URI uri) {
try {
readLock.lock();
if (fileSystem == null) {
throw new FileSystemNotFoundException();
throw new FileSystemNotFoundException("The Native Image Resource File System is not present. " +
"Please create a new file system using the `newFileSystem` operation before attempting any file system operations on resource URIs.");
}
return fileSystem;
} finally {
Expand Down

0 comments on commit 5cc94b9

Please sign in to comment.