We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1332b73 commit b0fed1bCopy full SHA for b0fed1b
index.js
@@ -52,11 +52,11 @@ function format (obj) {
52
var type = obj.type
53
54
if (!type || !TYPE_NAME_REGEXP.test(type)) {
55
- throw new TypeError('invalid type')
+ throw new TypeError('invalid type \'' + type + '\'')
56
}
57
58
if (!subtype || !SUBTYPE_NAME_REGEXP.test(subtype)) {
59
- throw new TypeError('invalid subtype')
+ throw new TypeError('invalid subtype \'' + subtype + '\'')
60
61
62
// format as type/subtype
@@ -114,7 +114,7 @@ function parse (string) {
114
var match = TYPE_REGEXP.exec(string.toLowerCase())
115
116
if (!match) {
117
- throw new TypeError('invalid media type')
+ throw new TypeError('invalid media type \''+ string + '\'')
118
119
120
var type = match[1]
0 commit comments