diff options
author | Anders Svensson <[email protected]> | 2014-01-16 12:57:43 +0100 |
---|---|---|
committer | Anders Svensson <[email protected]> | 2014-01-16 13:06:44 +0100 |
commit | 3f79e7bd7e743ffd40b624caf680aef2bdb15dc7 (patch) | |
tree | 1ad2f8d6e6aa60c30e4f8b0cc08af49fe993553b /lib/diameter/src/compiler/diameter_make.erl | |
parent | 17303e17116415e7758e96530814b0a6f3f9a93f (diff) | |
download | otp-3f79e7bd7e743ffd40b624caf680aef2bdb15dc7.tar.gz otp-3f79e7bd7e743ffd40b624caf680aef2bdb15dc7.tar.bz2 otp-3f79e7bd7e743ffd40b624caf680aef2bdb15dc7.zip |
Don't format diameter_make:codec/2 errors
Instead, add diameter_make:format_error/1 to allow the caller to format
if desired, which is what applications like compiler and yecc do. Use
this to check that the expected error is the one actually generated in
the compiler suite.
Diffstat (limited to 'lib/diameter/src/compiler/diameter_make.erl')
-rw-r--r-- | lib/diameter/src/compiler/diameter_make.erl | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/lib/diameter/src/compiler/diameter_make.erl b/lib/diameter/src/compiler/diameter_make.erl index 2f314b7e57..adc7808e49 100644 --- a/lib/diameter/src/compiler/diameter_make.erl +++ b/lib/diameter/src/compiler/diameter_make.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2010-2013. All Rights Reserved. +%% Copyright Ericsson AB 2010-2014. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -33,7 +33,8 @@ -export([codec/2, codec/1, format/1, - flatten/1]). + flatten/1, + format_error/1]). -export_type([opt/0]). @@ -81,8 +82,8 @@ codec(File, Opts) -> case parse(Dict, Opts) of {ok, ParseD} -> make(Path, default(Opts), ParseD); - {error = E, Reason} -> - {E, diameter_dict_util:format_error(Reason)} + {error, _} = E -> + E end. codec(File) -> @@ -115,6 +116,11 @@ flatten([?VERSION = V | Dict]) -> [grouped, import_groups], [enum, import_enums]])]. +%% format_error/1 + +format_error(T) -> + diameter_dict_util:format_error(T). + %% =========================================================================== %% flatten/2 |