~apreiml/hare-openpgp

22bae58e2513f68fb487c11460d6282de62d939e — Armin Preiml 6 months ago 6d67223
moved errors to separate file
1 files changed, 21 insertions(+), 0 deletions(-)

A format/openpgp/errors.ha
A format/openpgp/errors.ha => format/openpgp/errors.ha +21 -0
@@ 0,0 1,21 @@
use io;


export type unsupported = !void;
export type badsig = !void;
export type invalid = !void;

export type error = !(io::error | unsupported | badsig | invalid);

export fn strerror(e: error) str = {
	match (e) {
	case unsupported =>
		return "Unsupported";
	case badsig =>
		return "Signature verification failed";
	case invalid =>
		return "Invalid";
	case let e: io::error =>
		return io::strerror(e);
	};
};