Merge pull request #1103 from transloadit/chore/tl-tweaks

transloadit: Error tweaks
This commit is contained in:
Artur Paikin 2018-10-23 21:14:51 +03:00 committed by GitHub
commit d598efc044
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 1 deletions

View file

@ -19,7 +19,7 @@ function validateParams (params) {
if (!params.auth || !params.auth.key) {
throw new Error('Transloadit: The `params.auth.key` option is required. ' +
'You can find your Transloadit API key at https://transloadit.com/accounts/credentials.')
'You can find your Transloadit API key at https://transloadit.com/account/api-settings.')
}
}

View file

@ -67,8 +67,13 @@ module.exports = class Transloadit extends Plugin {
this._onRestored = this._onRestored.bind(this)
this._getPersistentData = this._getPersistentData.bind(this)
const hasCustomAssemblyOptions = this.opts.getAssemblyOptions !== defaultOptions.getAssemblyOptions
if (this.opts.params) {
AssemblyOptions.validateParams(this.opts.params)
} else if (!hasCustomAssemblyOptions) {
// Throw the same error that we'd throw if the `params` returned from a
// `getAssemblyOptions()` function is null.
AssemblyOptions.validateParams(null)
}
this.client = new Client({