Im using redirect::back()->withErrors($exception) but not able to display error message on my page. Here is my controller
try{
}
catch(ParseException $pex){
$error=var_dump($pex->getMessage());
return Redirect::back()->withInput()->withErros(array('msg'=>$error));
}
and here is my view
{ Form::open(array('action' =>'UsersController@register','class' => 'form-horizontal','id'=> 'registrationForm' ,'name' => 'registrationForm','method' => 'POST')) }}
<div class="body bg-gray">
<!--Kullanicinin girmesi gereken bilgiler-->
@if($errors->any())
<div class="form-group has-error">
<div class="col-sm-12">
<h4>Error:{{$erros->first('code')}}</h4><br/>
<label>{{$errors->first('msg')}}</label>
</div>
</div>
@endif
Any ideas? Thanks
withErros
dont you meanwithErrors
? That is within your catch segment.