code -> sqlCode

This commit is contained in:
Girish Ramakrishnan
2025-09-29 11:55:15 +02:00
parent 906e3f8cea
commit 5dd5a20fc1
14 changed files with 36 additions and 37 deletions
+1 -1
View File
@@ -57,7 +57,7 @@ async function add(data) {
const args = [ id, secret, data.name, data.appId, data.loginRedirectUri, data.tokenSignatureAlgorithm ];
const [error] = await safe(database.query(query, args));
if (error && error.code === 'ER_DUP_ENTRY') throw new BoxError(BoxError.ALREADY_EXISTS, 'client already exists');
if (error && error.sqlCode === 'ER_DUP_ENTRY') throw new BoxError(BoxError.ALREADY_EXISTS, 'client already exists');
if (error) throw error;
return { id, secret };