diff --git a/src/routes/add-article.ts b/src/routes/add-article.ts index 84470e90..24b3672c 100644 --- a/src/routes/add-article.ts +++ b/src/routes/add-article.ts @@ -7,7 +7,6 @@ import { termToString } from 'rdf-string'; import uniqueString from 'unique-string'; import url from 'url'; import { AppContext, AppMiddleware } from '../app'; -import NotAnArticle from '../errors/not-an-article'; import { rdf, schema } from '../namespaces'; import Routes from './index'; @@ -44,15 +43,7 @@ export default (): AppMiddleware => ( request.dataset.delete(originalQuad).add(newQuad); }); - try { - await articles.set(newId, request.dataset); - } catch (error) { - if (error instanceof NotAnArticle) { - throw new createHttpError.BadRequest(error.message); - } - - throw error; - } + await articles.set(newId, request.dataset); response.status = constants.HTTP_STATUS_CREATED; response.set('Location', url.resolve(request.origin, router.url(Routes.ArticleList)));