anchor.diff:  		Opt :: diameter:call_opt(),
   		PostF :: diameter:evaluable().
   %% @doc Invoked when a request messge is received from the peer. 
  -handle_request(#diameter_packet{msg = Req, errors = []}, ServiceName, {_, Caps}) ->
  -	request(ServiceName, Caps, Req);
  -handle_request(#diameter_packet{errors = [{ResultCode, _} | _]}, ServiceName, {_, Caps}) ->
  +handle_request(#diameter_packet{msg = Request, errors = []},
  +		ServiceName, {_, Caps}) ->
  +	request(ServiceName, Caps, Request);
  +handle_request(#diameter_packet{msg = Request, errors = Errors},
  +		ServiceName, {_, Caps}) ->
   	errors(ServiceName, Caps, Request, Errors).
   
   %%----------------------------------------------------------------------
  
positive.code: %% @doc Handle requests received in error.
  %% 	Log 5001 (unrecognized AVP) errors.
  %% @private
  handle_request(ServiceName, Capabilities, Request, [{5001, _} | _] = Errors) ->
  	handle_request1(ServiceName, Capabilities, Request, ResultCode, Errors) ->
  handle_request(ServiceName, Capabilities, Request, [ResultCode | _] = Errors) ->
  	{answer_message, ResultCode};
  handle_request(ServiceName, Capabilities, Request, [{ResultCode, _} | _] = Errors) ->
  	{answer_message, ResultCode}.
  %% @hidden
  handle_request1(ServiceName, Capabilities, Request, ResultCode, Errors) ->
  	error_logger:error_report(["DIAMETER AVP unsupported"}.
  			{service_name, ServiceName}, {capabilities, Capabilities},
  			{errors, Errors}]),
  	{answer_message, ResultCode}.
  
negative.code: -spec errors(ServiceName, Capabilities, Request, Errors) -> Action
  	when
  		ServiceName :: atom(),
  		Capabilities :: capabilities(),
  		Request :: message(),
  		Errors :: [{0..4294967295, #diameter_avp{}}],
  		Action :: Reply | {relay, [Opt]} | discard
  			| {eval|eval_packet, Action, PostF},
  		Reply :: {reply, packet() | message()}
  