diff options
| author | Gustav Sörnäs <gustav@sornas.net> | 2021-03-10 18:44:59 +0100 |
|---|---|---|
| committer | Gustav Sörnäs <gustav@sornas.net> | 2021-03-10 18:44:59 +0100 |
| commit | 0275d67aba60706ed6c1311af615e97653c751dc (patch) | |
| tree | b0085d348b517b41aa8cfe2ec04c7cd27eaec611 /src/error.rs | |
| parent | 21b76633d149f62dbfdf55702dbdf8c84bf14105 (diff) | |
| download | sylt-main.tar.gz | |
handle file not founds everywheremain
Diffstat (limited to 'src/error.rs')
| -rw-r--r-- | src/error.rs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/error.rs b/src/error.rs index f967685..52bcc82 100644 --- a/src/error.rs +++ b/src/error.rs @@ -143,3 +143,13 @@ impl fmt::Display for Error { } } +impl Error { + pub fn new_nowhere(kind: ErrorKind, message: Option<String>) -> Self { + Self { + kind, + message, + file: PathBuf::from("!compiler!"), + line: 0, + } + } +} |
