Browse Source

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

transloadit: Error tweaks
Artur Paikin 6 years ago
parent
commit
d598efc044

+ 1 - 1
packages/@uppy/transloadit/src/AssemblyOptions.js

@@ -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.')
   }
 }
 

+ 5 - 0
packages/@uppy/transloadit/src/index.js

@@ -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({