Skip to content

Commit 803dfa0

Browse files
authored
Refactor AmpHandler to simplify try-catch block
1 parent 385de10 commit 803dfa0

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

libs/remix-ai-core/src/remix-mcp-server/handlers/AmpHandler.ts

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -71,18 +71,14 @@ async function performAmpQuery<T = any>(
7171
baseUrl?: string,
7272
authToken?: string
7373
): Promise<Array<T>> {
74-
try {
75-
const ampClient = await createAmpClient(baseUrl, authToken)
76-
const data: Array<T> = []
74+
const ampClient = await createAmpClient(baseUrl, authToken)
75+
const data: Array<T> = []
7776

78-
for await (const batch of ampClient.query(query)) {
79-
data.push(...batch)
80-
}
81-
82-
return data
83-
} catch (error) {
84-
throw error
77+
for await (const batch of ampClient.query(query)) {
78+
data.push(...batch)
8579
}
80+
81+
return data
8682
}
8783

8884
/**

0 commit comments

Comments
 (0)