fix(module): correct errors when template is Object

This commit is contained in:
Pooya Parsa 2018-04-12 23:46:08 +04:30
parent 3b4955152e
commit 05efd73136

View File

@ -28,7 +28,7 @@ export default class ModuleContainer {
addTemplate(template) { addTemplate(template) {
/* istanbul ignore if */ /* istanbul ignore if */
if (!template) { if (!template) {
throw new Error('Invalid template:' + template) throw new Error('Invalid template:' + JSON.stringify(template))
} }
// Validate & parse source // Validate & parse source
@ -36,7 +36,7 @@ export default class ModuleContainer {
const srcPath = path.parse(src) const srcPath = path.parse(src)
/* istanbul ignore if */ /* istanbul ignore if */
if (!src || typeof src !== 'string' || !fs.existsSync(src)) { if (!src || typeof src !== 'string' || !fs.existsSync(src)) {
throw new Error('Template not found:' + template) throw new Error('Template src not found:' + src)
} }
// Generate unique and human readable dst filename // Generate unique and human readable dst filename