Skip to content

Commit

Permalink
Parametrizar los mensajes de error
Browse files Browse the repository at this point in the history
Referencia: #31
  • Loading branch information
Jorge Alberto Cricelli committed Sep 2, 2017
1 parent 8cf2ece commit ad984c5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions app/Controller/EncuestasController.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ public function index($id = null) {

$this->Encuesta->Estudiante->id = $id;
if (!$this->Encuesta->Estudiante->exists()) {
throw new NotFoundException('Estudiante inválido');
throw new NotFoundException(sprintf('%s inválido', Plataforma::esTutorias() ? 'Estudiante' : 'Graduado'));
}

$estudiante = $this->Encuesta->Estudiante->read();
Expand All @@ -23,7 +23,7 @@ public function regenerate($id = null) {

$this->Encuesta->Estudiante->id = $id;
if (!$this->Encuesta->Estudiante->exists()) {
throw new NotFoundException('Estudiante inválido');
throw new NotFoundException(sprintf('%s inválido', Plataforma::esTutorias() ? 'Estudiante' : 'Graduado'));
}

$estudiante = $this->Encuesta->Estudiante->read();
Expand All @@ -41,7 +41,7 @@ public function save() {
$this->Encuesta->id = $this->data['encuestaId'];

if (!$this->Encuesta->exists()) {
throw new NotFoundException('Estudiante inválido');
throw new NotFoundException(sprintf('%s inválido', Plataforma::esTutorias() ? 'Estudiante' : 'Graduado'));
}

$this->Encuesta->set('respuesta', $this->data['respuesta']);
Expand Down

0 comments on commit ad984c5

Please sign in to comment.