mirror of
https://github.com/filecoin-project/slate.git
synced 2024-12-21 08:01:33 +03:00
14 lines
290 B
JavaScript
14 lines
290 B
JavaScript
import DB from "~/node_common/database";
|
|
|
|
export const runQuery = async ({ queryFn, errorFn, label }) => {
|
|
let response;
|
|
try {
|
|
response = await queryFn(DB);
|
|
} catch (e) {
|
|
response = errorFn(e);
|
|
}
|
|
|
|
console.log("[ database-query ]", { query: label });
|
|
return response;
|
|
};
|