Skip to content

Commit

Permalink
[ci] format
Browse files Browse the repository at this point in the history
  • Loading branch information
bholmesdev authored and astrobot-houston committed May 13, 2024
1 parent eb1d9a4 commit c135cd5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions packages/db/src/runtime/db-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,9 @@ const KNOWN_ERROR_CODES = {
};

const getUnexpectedResponseMessage = async (response: Response) =>
`Unexpected response from remote database:\n(Status ${response.status}) ${await response.clone().text()}`;
`Unexpected response from remote database:\n(Status ${response.status}) ${await response
.clone()
.text()}`;

async function parseRemoteError(response: Response): Promise<DetailedLibsqlError> {
let error;
Expand All @@ -170,7 +172,8 @@ async function parseRemoteError(response: Response): Promise<DetailedLibsqlError
});
}
// Strip LibSQL error prefixes
let baseDetails = error.details?.replace(/.*SQLite error: /, '') ?? 'Error querying remote database.';
let baseDetails =
error.details?.replace(/.*SQLite error: /, '') ?? 'Error querying remote database.';
// Remove duplicated "code" in details
const details = baseDetails.slice(baseDetails.indexOf(':') + 1).trim();
let hint = `See the Astro DB guide for query and push instructions: https://docs.astro.build/en/guides/astro-db/#query-your-database`;
Expand Down
2 changes: 1 addition & 1 deletion packages/db/test/test-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ function createRemoteDbServer() {
error: {
code: e instanceof LibsqlError ? e.code : 'SQLITE_QUERY_FAILED',
details: e.message,
}
},
})
);
}
Expand Down

0 comments on commit c135cd5

Please sign in to comment.