From 0275d67aba60706ed6c1311af615e97653c751dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gustav=20S=C3=B6rn=C3=A4s?= Date: Wed, 10 Mar 2021 18:44:59 +0100 Subject: handle file not founds everywhere --- src/error.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/error.rs') 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) -> Self { + Self { + kind, + message, + file: PathBuf::from("!compiler!"), + line: 0, + } + } +} -- cgit v1.2.1