Skip to content

Commit

Permalink
error 500 stack
Browse files Browse the repository at this point in the history
  • Loading branch information
aymericdo committed Jan 29, 2024
1 parent ac5cfe9 commit 6721011
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 8 deletions.
1 change: 1 addition & 0 deletions src/interfaces/shared.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export interface ApiError {
msg: string
isIncompleteAd?: boolean
incompleteAd?: IncompleteAd
stack?: string
}

export interface AddressItem {
Expand Down
2 changes: 1 addition & 1 deletion src/services/api/errors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export class ApiErrorsService {
PrettyLog.call(this.error.msg, 'yellow')
break
default: {
const errorMsg = `${ERROR500_MSG} ${this.error}`
const errorMsg = `${ERROR500_MSG} ${this.error?.stack || this.error}`
PrettyLog.call(errorMsg, 'red')
new SentryService().error(errorMsg)
break
Expand Down
8 changes: 1 addition & 7 deletions src/services/websites/orpi/orpi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,21 +46,15 @@ export class Orpi extends Website {
id: ad.id.toString(),
charges: cleanup.number(ad.charges),
cityLabel: cleanup.string(ad.cityLabel),
coord: {
lat: +ad.coord.lat,
lng: +ad.coord.lng,
},
description: cleanup.string(ad.description),
dpe: ad.dpe ? cleanup.string(ad.dpe) : null,
hasCharges: ad.hasCharges,
furnished: ad.furnished,
price: ad.price,
postalCode: ad.postalCode,
price: cleanup.price(ad.price),
renter: cleanup.string(ad.renter),
rooms: ad.rooms,
surface: ad.surface,
title: cleanup.string(ad.title),
yearBuilt: !!ad.yearBuilt && ad.yearBuilt,
}
}
}

0 comments on commit 6721011

Please sign in to comment.