Reuse existing error codes to throw an error instead of creating a new one.
MODIFY
src/server/rest/v1/service/SiteService.ts
src/server/rest/v1/service/SiteService.ts
@@ -400,7 +400,7 @@ export default class SiteService {
if (publicChargingStation) {
throw new AppError({
source: Constants.CENTRAL_SERVER,
- errorCode: HTTPError.SITE_WITH_PUBLIC_CHARGER_ERROR,
+ errorCode: HTTPError.FEATURE_NOT_SUPPORTED_ERROR,
message: `Cannot set site ${site.name} to private as charging station ${publicChargingStation.id} under site is public`,
module: MODULE_NAME, method: 'handleUpdateSite',
user: req.user,

MODIFY
src/types/HTTPError.ts
src/types/HTTPError.ts
@@ -43,7 +43,6 @@ export enum HTTPError {
CHARGER_WITH_NO_SITE_AREA_ERROR = 525,
SITE_AREA_WITH_NO_SITE_ERROR = 525,
USER_WITH_NO_SITE_ERROR = 525,
- SITE_WITH_PUBLIC_CHARGER_ERROR = 526,
BILLING_DELETE_ERROR = 510, // FIXME: override an already defined HTTP status code: Not extended (RFC 2774)

Reuse existing error codes to throw an error instead of creating a new one.