From 49a45620c2c0431583969192fbefe44ee6f7850c Mon Sep 17 00:00:00 2001 From: Eric Date: Tue, 18 Sep 2012 15:51:47 -0700 Subject: make sure errors carry the name of the module that created them This allows errors to be printed at the source --- include/relcool.hrl | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'include') diff --git a/include/relcool.hrl b/include/relcool.hrl index 732e5d3..11a0dec 100644 --- a/include/relcool.hrl +++ b/include/relcool.hrl @@ -18,3 +18,10 @@ -define(RCL_ERROR, 0). -define(RCL_INFO, 1). -define(RCL_DEBUG, 2). + +%% This is the default form of error messages for the Relcool +%% system. It is expected that everything that returns an error use +%% this and that they all expose a format_error/1 message that returns +%% an iolist. +-define(RCL_ERROR(Reason), + {error, {?MODULE, Reason}}). -- cgit v1.2.3