WIP: store, narinfo, sign, nar, cache, closure packages
This commit is contained in:
1 parent
4e7ce11973
commit
988c942952
28 files changed
+1432
No files matched your search
@@ -0,0 +1,32 @@
|
||||
///|
|
||||
/// Single error type shared by all mnix packages. Every failure is loud:
|
||||
/// there are no silent fallbacks anywhere in the code base.
|
||||
pub(all) suberror NixError {
|
||||
Parse(String)
|
||||
Verify(String)
|
||||
Network(String)
|
||||
Io(String)
|
||||
Unsupported(String)
|
||||
}
|
||||
|
||||
///|
|
||||
pub impl Show for NixError with fn output(self, logger) {
|
||||
match self {
|
||||
Parse(m) => logger.write_string("parse error: \{m}")
|
||||
Verify(m) => logger.write_string("verification failed: \{m}")
|
||||
Network(m) => logger.write_string("network error: \{m}")
|
||||
Io(m) => logger.write_string("I/O error: \{m}")
|
||||
Unsupported(m) => logger.write_string("unsupported: \{m}")
|
||||
}
|
||||
}
|
||||
|
||||
///|
|
||||
/// Test helper: true if `f` raises.
|
||||
pub fn[T] raises(f : () -> T raise) -> Bool {
|
||||
try {
|
||||
ignore(f())
|
||||
false
|
||||
} catch {
|
||||
_ => true
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user