Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,11 @@ function format (obj) {
var type = obj.type

if (!type || !TYPE_NAME_REGEXP.test(type)) {
throw new TypeError('invalid type')
throw new TypeError('invalid type \'' + type + '\'')
}

if (!subtype || !SUBTYPE_NAME_REGEXP.test(subtype)) {
throw new TypeError('invalid subtype')
throw new TypeError('invalid subtype \'' + subtype + '\'')
}

// format as type/subtype
Expand Down Expand Up @@ -114,7 +114,7 @@ function parse (string) {
var match = TYPE_REGEXP.exec(string.toLowerCase())

if (!match) {
throw new TypeError('invalid media type')
throw new TypeError('invalid media type \'' + string + '\'')
}

var type = match[1]
Expand Down