mirror of
https://github.com/laurent22/joplin.git
synced 2025-01-23 18:53:36 +02:00
Server: Improve log quality by increasing specificity of error (#10287)
This commit is contained in:
parent
681d1d67f3
commit
837826ea4f
@ -390,13 +390,13 @@ export default abstract class BaseModel<T> {
|
||||
}
|
||||
|
||||
public async load(id: Uuid | number, options: LoadOptions = {}): Promise<T> {
|
||||
if (!id) throw new Error('id cannot be empty');
|
||||
if (!id) throw new ErrorBadRequest('id cannot be empty');
|
||||
|
||||
return this.db(this.tableName).select(options.fields || this.defaultFields).where({ id: id }).first();
|
||||
}
|
||||
|
||||
public async delete(id: string | string[] | number | number[], options: DeleteOptions = {}): Promise<void> {
|
||||
if (!id) throw new Error('id cannot be empty');
|
||||
if (!id) throw new ErrorBadRequest('id cannot be empty');
|
||||
|
||||
const ids = (typeof id === 'string' || typeof id === 'number') ? [id] : id;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user