Skip to content
This repository has been archived by the owner on Sep 18, 2021. It is now read-only.

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Dmitry Groshev committed Jul 8, 2012
1 parent 9e93eaf commit 7c8457b
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 20 deletions.
2 changes: 1 addition & 1 deletion example/priv/conf.yaml
Expand Up @@ -2,7 +2,7 @@ example:
srv_conf:
iface:
ip: 127.0.0.1
port: 83
port: 82
hostname: example server
header: hello world
conn_type: http
Expand Down
3 changes: 0 additions & 3 deletions src/nakaz.erl
Expand Up @@ -13,9 +13,6 @@

-export([start/2, stop/1]).

%% Types


%% API

start() ->
Expand Down
14 changes: 1 addition & 13 deletions src/nakaz_core.erl
Expand Up @@ -5,13 +5,9 @@

-include_lib("z_validate/include/z_validate.hrl").

%% FIXME(Sergei): remove!
-compile(export_all).


%% API
-export([start_link/1]).
-export([ensure/4, use/3, reload/0]).
-export([ensure/4, use/3, reload/0, reload/1]).

%% gen_server callbacks
-export([init/1, handle_call/3, handle_cast/2, handle_info/2,
Expand Down Expand Up @@ -268,14 +264,6 @@ zz_verify_ok(Val) ->
Other -> ?Z_THROW({unknown_value, Other})
end.

-spec zz_verify_ok({ok, A} | {error, any()}, any()) -> A when A :: any().
zz_verify_ok(Val, Err) ->
case Val of
{ok, ValOk} -> ValOk;
{error, Reason} -> ?Z_THROW(Reason);
_ -> ?Z_THROW(Err)
end.

-spec zz_defined(A | undefined, any()) -> A when A :: any().
zz_defined(Val, Err) ->
case Val of
Expand Down
5 changes: 2 additions & 3 deletions src/nakaz_errors.erl
Expand Up @@ -12,7 +12,6 @@ render(Error) ->

-spec r(any()) -> {string(), [any()]}.
r({cant_execute_magic_fun, Mod}) ->
%% FIXME(Dmitry): rename parsetransform to nakaz_pt
{"Can't execute 'magic function' that must be generated "
"by nakaz_pt in module ~s", [Mod]};
r(empty) ->
Expand All @@ -31,9 +30,9 @@ r({missing, {field, Name, Section}}) ->
{"Missing field ~p in section ~p", [Name, Section]};
r({invalid, {Name, Type, Value, {Line, _Column}}}) ->
{"Invalid type at line ~p: value ~p for field ~p doesn't match ~s",
[Line, Value, Name, pp_type(Type)]};
[Line+1, Value, Name, pp_type(Type)]};
r({unsupported, Line, Mod}) ->
{"Unsupported type expression at ~p.erl:~p", [Mod, Line]};
{"Unsupported type expression at ~p.erl:~p", [Mod, Line+1]};
r(UnknownError) ->
io:format("~p~n", [UnknownError]),
ok = lager:warning("no clause for rendering error ~p", [UnknownError]),
Expand Down

0 comments on commit 7c8457b

Please sign in to comment.