settings throw errors when missing mandatory properties

This commit is contained in:
Erik 2022-07-30 18:00:31 +03:00
parent feb9df0043
commit a7bdf10ac5
Signed by untrusted user: Navy.gif
GPG Key ID: 811EC0CD80E7E5FB

View File

@ -48,7 +48,10 @@ class Setting extends Component {
* @memberof Setting
*/
constructor(client, options = {}) {
if(!options) return null;
if (!options) throw new Error(`No options provided to setting`);
if (!options.name) throw new Error(`Setting missing name`);
if (!options.module) throw new Error(`Missing module for ${options.name}`);
super(client, {
id: options.name,