0

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

2
  • 4
    withErros dont you mean withErrors? That is within your catch segment. Commented Nov 27, 2014 at 10:36
  • Exactly, it should be withErrors. By the way, it was a stupid syntax mistake it is fixed. Commented Nov 27, 2014 at 14:06

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.