Skip to content

Commit

Permalink
chore(sentry): add app version to sentry context (#1506)
Browse files Browse the repository at this point in the history
  • Loading branch information
phucledien authored Oct 2, 2023
1 parent 1fb1328 commit aee2cca
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 3 deletions.
15 changes: 12 additions & 3 deletions src/types/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -765,6 +765,7 @@ export interface RequestOffchainTransferRequest {
platform?: string
recipients?: string[]
sender?: string

/** AmountString string `json:"amount_string"` */
token?: string
transfer_type?: string
Expand Down Expand Up @@ -1062,9 +1063,7 @@ export interface ResponseCoinMarketItemData {
price_change_percentage_24h?: number
price_change_percentage_24h_in_currency?: number
price_change_percentage_7d_in_currency?: number
sparkline_in_7d?: {
price?: number[]
}
sparkline_in_7d?: { price?: number[] }
symbol?: string
}

Expand Down Expand Up @@ -1148,17 +1147,21 @@ export interface ResponseCreateUserTokenSupportRequest {

export interface ResponseDataFilterConfigByReaction {
data?: ResponseRoleReactionResponse

/** page index */
page?: number

/** page size */
size?: number
total?: number
}

export interface ResponseDataListRoleReactionResponse {
data?: ResponseListRoleReactionResponse

/** page index */
page?: number

/** page size */
size?: number
total?: number
Expand Down Expand Up @@ -1217,6 +1220,7 @@ export interface ResponseDiscordGuildResponse {
id?: string
name?: string
owner?: boolean

/** @example 0 */
permissions?: string
}
Expand Down Expand Up @@ -1437,8 +1441,10 @@ export interface ResponseGetInvestListResponse {

export interface ResponseGetLevelRoleConfigsResponse {
data?: ModelGuildConfigLevelRole[]

/** page index */
page?: number

/** page size */
size?: number
total?: number
Expand Down Expand Up @@ -1556,6 +1562,7 @@ export interface ResponseGetTrackingWalletsResponse {

export interface ResponseGetTrendingSearch {
coins?: ResponseGetTrendingSearchCoin[]

/** this field coingecko return empty */
exchanges?: any
}
Expand Down Expand Up @@ -2074,6 +2081,7 @@ export interface ResponseOnchainInvestDataResponse {
export interface ResponsePaginationResponse {
/** page index */
page?: number

/** page size */
size?: number
total?: number
Expand Down Expand Up @@ -2321,6 +2329,7 @@ export interface UtilPagination {

export interface UuidNullUUID {
uuid?: string

/** Valid is true if UUID is not NULL */
valid?: boolean
}
10 changes: 10 additions & 0 deletions src/utils/wrap-error.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import ChannelLogger from "../logger/channel"
import { getCommandMetadata } from "./commands"
import { kafkaQueue } from "queue/kafka/queue"
import { Sentry } from "sentry"
import { version } from "../../package.json"

function catchAll(e: any) {
logger.error(e)
Expand Down Expand Up @@ -72,6 +73,9 @@ export async function wrapError(
raw: commandStr,
args,
},
app: {
app_version: `v${version}`,
},
},
})
}
Expand Down Expand Up @@ -104,6 +108,9 @@ export async function wrapError(
.map((option) => option.value)
.join(" "),
},
app: {
app_version: `v${version}`,
},
},
})
}
Expand All @@ -122,6 +129,9 @@ export async function wrapError(
raw: commandStr,
args,
},
app: {
app_version: `v${version}`,
},
},
})
}
Expand Down

0 comments on commit aee2cca

Please sign in to comment.