@@ -182,7 +182,6 @@ auth({$R, <<M:?int32, _/binary>>}, State) ->
{stop, Error, reply(State, Error)};
%% ErrorResponse
-%% TODO who decodes error ?
auth({error, E}, State) ->
case E#error.code of
<<"28000">> -> Why = invalid_authorization_specification;
@@ -12,7 +12,12 @@ decode_message(<<Type:8, Len:?int32, Rest/binary>> = Bin) ->
Len2 = Len - 4,
case Rest of
<<Data:Len2/binary, Tail/binary>> ->
- {{Type, Data}, Tail};
+ case Type of
+ $E ->
+ {{error, decode_error(Data)}, Tail};
+ _ ->
+ {{Type, Data}, Tail}
+ end;
_Other ->
Bin
end;