Permalink
Browse files

Merge pull request #671 from danikp/master

beta1
  • Loading branch information...
2 parents be5a7cc + c1a1b54 commit 6397c5e27c6175fa17d888e34ffdebdcc1a260fc @danikp danikp committed on GitHub Aug 19, 2017
Showing with 39 additions and 22 deletions.
  1. +20 −20 src/boss/boss_web.hrl
  2. +19 −2 src/boss/boss_web_controller_render.erl
View
@@ -2,32 +2,32 @@
-define(DEBUGPRINT(A), error_logger:info_report("~~o)> " ++ A)).
-define(BUILTIN_CONTROLLER_FILTERS, [boss_lang_filter, boss_cache_page_filter, boss_cache_vars_filter]).
-define(PRINT(N,V),
- lager:notice(" ~s ~p", [ N,V])).
+ lager:notice(" ~s ~p", [ N,V])).
-include_lib("eunit/include/eunit.hrl").
-record(boss_app_info, {
- application ::atom(),
- base_url ::string(),
- static_prefix ::string(),
- doc_prefix ::string(),
- domains ::all|[string()],
- init_data ::[{atom(), any()}] ,
- router_sup_pid ::pid(),
- router_pid ::pid(),
- translator_sup_pid ::pid(),
- translator_pid ::pid(),
- model_modules = [] ::[atom()],
- view_modules = [] ::[atom()],
- controller_modules = [] ::[atom()]
+ application :: atom(),
+ base_url :: 'undefined' | string(),
+ static_prefix :: 'undefined' | string(),
+ doc_prefix :: 'undefined' | string(),
+ domains :: 'undefined' | 'all' | [string()],
+ init_data :: 'undefined' | [{atom(), any()}] ,
+ router_sup_pid :: 'undefined' | pid(),
+ router_pid :: 'undefined' | pid(),
+ translator_sup_pid :: 'undefined' | pid(),
+ translator_pid :: 'undefined' | pid(),
+ model_modules = [] :: [atom()],
+ view_modules = [] :: [atom()],
+ controller_modules = [] :: [atom()]
}).
-record(state, {
- applications = [] ::[ #boss_app_info{}],
- router_adapter ::atom(),
- service_sup_pid ::pid(),
- http_pid ::pid(),
- smtp_pid ::pid(),
- is_master_node = false ::boolean()
+ applications = [] :: [ #boss_app_info{}],
+ router_adapter :: atom(),
+ service_sup_pid :: pid(),
+ http_pid :: pid(),
+ smtp_pid :: pid(),
+ is_master_node = false :: boolean()
}).
@@ -33,7 +33,22 @@
-spec process_action_result({_,_,nonempty_maybe_improper_list()},_,[],_) -> any().
-spec process_location(_,nonempty_maybe_improper_list(),#boss_app_info{}) -> {_,string(),_}.
-spec process_redirect(_,_,_) -> any().
--spec render_error(_,_,#boss_app_info{application::atom(),base_url::'undefined' | string(),static_prefix::'undefined' | string(),doc_prefix::'undefined' | string(),domains::'all' | 'undefined' | [string()],init_data::'undefined' | [{atom(),_}],router_sup_pid::'undefined' | pid(),router_pid::'undefined' | pid(),translator_sup_pid::'undefined' | pid(),translator_pid::'undefined' | pid(),model_modules::[atom()],view_modules::[atom()],controller_modules::[atom()]},[any()]) -> {'error',_} | {'error',[any()],[]}.
+-spec render_error(_, _,
+ #boss_app_info{
+ application :: atom(),
+ base_url :: 'undefined' | string(),
+ static_prefix :: 'undefined' | string(),
+ doc_prefix :: 'undefined' | string(),
+ domains :: 'all' | 'undefined' | [string()],
+ init_data :: 'undefined' | [{atom(),_}],
+ router_sup_pid :: 'undefined' | pid(),
+ router_pid :: 'undefined' | pid(),
+ translator_sup_pid :: 'undefined' | pid(),
+ translator_pid :: 'undefined' | pid(),
+ model_modules :: [atom()],
+ view_modules :: [atom()],
+ controller_modules :: [atom()]
+ },[any()]) -> {'error',_} | {'error',[any()],[]}.
-spec render_errors(_,#boss_app_info{},[any()]) -> any().
-spec render_result(_,_,_,_,_,_,_,_) -> any().
-spec render_view({_,_,_},_,[any()]) -> any().
@@ -46,7 +61,9 @@
%% (seems to be called on runtime error)
render_error(Error, ExtraMessage, AppInfo, RequestContext) ->
case boss_html_error_template:render(RequestContext ++ [
- {error, Error}, {extra_message, ExtraMessage}, {appinfo, AppInfo},
+ {error, Error},
+ {extra_message, ExtraMessage},
+ {appinfo, AppInfo},
{'_base_url', AppInfo#boss_app_info.base_url},
{'_static', AppInfo#boss_app_info.static_prefix}]) of
{ok, Payload} ->

0 comments on commit 6397c5e

Please sign in to comment.