Skip to content

Commit 8591a79

Browse files
timabellclaude
andcommitted
Use statusCodes.notFound instead of the magic 404
SonarCloud S109 on the ApiError 404 handling. Use the existing shared statusCodes constant rather than a bare literal. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent c91c3e6 commit 8591a79

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/server/routes/certificatesOfCompliance/certificates-of-compliance.service.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { config } from '#config/config.js'
22
import { ApiError } from '#services/apiBaseClient/api-error.js'
3+
import { statusCodes } from '#server/common/constants/status-codes.js'
34
import { createAccountApiService } from '#services/account-api.service.js'
45
import { format, isDate, parseISO } from 'date-fns'
56
import { createWasteObligationsApiService } from '#services/waste-obligations-api.service.js'
@@ -523,7 +524,7 @@ async function fetchSubmitterPhoneNumber(accountApi, audit, traceId) {
523524
const details = await accountApi.getAccountDetailsById(userId, traceId)
524525
return details.telephone ?? null
525526
} catch (err) {
526-
if (err instanceof ApiError && err.status === 404) {
527+
if (err instanceof ApiError && err.status === statusCodes.notFound) {
527528
return null
528529
}
529530
throw err

0 commit comments

Comments
 (0)