mirror of
https://github.com/filecoin-project/slate.git
synced 2024-11-24 14:56:27 +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;
|
|
};
|