MCPcopy Index your code
hub / github.com/simstudioai/sim / extractTrelloErrorMessage

Function extractTrelloErrorMessage

apps/sim/tools/trello/shared.ts:233–262  ·  view source on GitHub ↗
(
  response: Response,
  data: unknown,
  fallback: string
)

Source from the content-addressed store, hash-verified

231}
232
233export function extractTrelloErrorMessage(
234 response: Response,
235 data: unknown,
236 fallback: string
237): string {
238 const parts: string[] = []
239
240 if (isRecordLike(data)) {
241 const message = data.message
242 const error = data.error
243
244 if (typeof message === 'string' && message.trim().length > 0) {
245 parts.push(message)
246 }
247
248 if (typeof error === 'string' && error.trim().length > 0 && error !== message) {
249 parts.push(error)
250 }
251 }
252
253 if (parts.length > 0) {
254 return `${fallback}: ${parts.join(' - ')}`
255 }
256
257 if (response.statusText) {
258 return `${fallback}: ${response.status} ${response.statusText}`
259 }
260
261 return fallback
262}

Callers 13

add_comment.tsFile · 0.90
get_card.tsFile · 0.90
add_label.tsFile · 0.90
create_list.tsFile · 0.90
get_actions.tsFile · 0.90
add_checklist.tsFile · 0.90
update_card.tsFile · 0.90
create_card.tsFile · 0.90
create_board.tsFile · 0.90
get_board.tsFile · 0.90
list_cards.tsFile · 0.90
list_lists.tsFile · 0.90

Calls 3

isRecordLikeFunction · 0.90
joinMethod · 0.80
pushMethod · 0.45

Tested by

no test coverage detected