Skip to content

Commit

Permalink
Fix error when job is not found
Browse files Browse the repository at this point in the history
  • Loading branch information
To-om committed Jun 29, 2018
1 parent d7bc48d commit 81d2a78
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion app/org/thp/cortex/services/JobSrv.scala
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,11 @@ class JobSrv(
findForOrganization(organizationId, withId(jobId), Some("0-1"), Nil)
}
._1
.runWith(Sink.head)
.runWith(Sink.headOption)
.flatMap {
case Some(j) Future.successful(j)
case None Future.failed(NotFoundError(s"job $jobId not found"))
}
}

def delete(job: Job)(implicit authContext: AuthContext): Future[Job] = deleteSrv(job)
Expand Down

0 comments on commit 81d2a78

Please sign in to comment.