私はLaravel 5.1アプリケーションからフロントエンドの角度アプリにエラーを投げようとしています。スローされたエラーは、私が必要とする実際のステータスメッセージ、返送されていません。Laravel 5はエラーメッセージを返さない
if (Hash::check($updated_profile['current_password'], $user->password)) {
$user->password = Hash::make($updated_profile['new_password']);
return $user;
} else {
abort(500, 'Passwords do not match');
}
を私はまた、両方のためにthrow new \Exception('Passwords do not match');
を試してみた、私はフロントエンドでエラーが出るが、それはステータスメッセージが欠落しています:
Object
data: null
headers:(name)
status: 0
statusText:""
__proto__: Object
のように、この機能を使用することができますが、APIパッケージまたはあなたのコントローラをワープ何かを使用していますか? –
私はoauth2パッケージでラッピングしています – Growler