Skip to content

Commit

Permalink
fix(database#set): has ambiguity when throws
Browse files Browse the repository at this point in the history
  • Loading branch information
PFiS1737 committed Jul 14, 2024
1 parent 14a5b54 commit c297cee
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/lib/database/Database.class.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,8 @@ export class Database<V extends Serializable> {
async set(key: string, value: V) {
await this.delete(key)
const data = serialize({ [key]: value }).replaceAll('"', "'")
// FIXME: has ambiguity
if (data.length > 32767)
throw new RangeError(
"Database: Only accepts a string value less than 32767 characters."
)
throw new RangeError("Database: Value is too long.")
await asyncRun(() => this.objective.setScore(data, 1))

this._syncDataFromScoreboard()
Expand Down

0 comments on commit c297cee

Please sign in to comment.