Skip to content

Commit 2c1e7ee

Browse files
committed
More natural language 500 error messages.
1 parent c4e3467 commit 2c1e7ee

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

  • server/controllers/things/models/commons

server/controllers/things/models/commons/journal.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ const error_ = __.require('lib', 'error')
66
module.exports = {
77
create: function (type) {
88
if (!type) {
9-
throw error_.new('expected a type', 500, arguments)
9+
throw error_.new('Type attribute missing.', 500, arguments)
1010
}
1111
var journal = {
1212
context: 'journal',
@@ -18,7 +18,7 @@ module.exports = {
1818
update: function (journalDoc, newVersionDoc) {
1919
const versionId = newVersionDoc._id
2020
if (!_.isUuid(versionId)) {
21-
throw error_.new('expected version id to be a Couchdb uuid', 500, arguments)
21+
throw error_.new('Version attribute not a UUID.', 500, arguments)
2222
}
2323
journalDoc.versions.push(versionId)
2424
journalDoc.data = newVersionDoc.data

0 commit comments

Comments
 (0)