aboutsummaryrefslogtreecommitdiffstats
path: root/src/rcl_util.erl
diff options
context:
space:
mode:
authorTristan Sloughter <[email protected]>2012-12-26 18:10:28 -0800
committerTristan Sloughter <[email protected]>2012-12-26 18:10:28 -0800
commited855acb2246aaa05d2fab628e1e09d1082b06a8 (patch)
tree7123eb46c722745abe5db11a9a52eb8f598d5786 /src/rcl_util.erl
parentcef19567813d442fe8190bbd5404e0b6ce3ac153 (diff)
parent078d3c349b3f465dc2f45f0bbfcff297e82074e5 (diff)
downloadrelx-ed855acb2246aaa05d2fab628e1e09d1082b06a8.tar.gz
relx-ed855acb2246aaa05d2fab628e1e09d1082b06a8.tar.bz2
relx-ed855acb2246aaa05d2fab628e1e09d1082b06a8.zip
Merge pull request #19 from ericbmerritt/next
overlay support
Diffstat (limited to 'src/rcl_util.erl')
-rw-r--r--src/rcl_util.erl14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/rcl_util.erl b/src/rcl_util.erl
index f6427ae..f89ba73 100644
--- a/src/rcl_util.erl
+++ b/src/rcl_util.erl
@@ -23,6 +23,8 @@
-export([mkdir_p/1,
to_binary/1,
+ is_error/1,
+ error_reason/1,
indent/1]).
-define(ONE_LEVEL_INDENT, " ").
@@ -55,6 +57,18 @@ to_binary(String) when erlang:is_list(String) ->
to_binary(Bin) when erlang:is_binary(Bin) ->
Bin.
+%% @doc get the reason for a particular relcool error
+-spec error_reason(relcool:error()) -> any().
+error_reason({error, {_, Reason}}) ->
+ Reason.
+%% @doc check to see if the value is a relcool error
+-spec is_error(relcool:error() | any()) -> boolean().
+is_error({error, _}) ->
+ true;
+is_error(_) ->
+ false.
+
+
%%%===================================================================
%%% Test Functions