Skip to content

Commit b8526bb

Browse files
boutellharoun
andauthored
FOR MI: PRO-9389: beta release of an apostrophe-astro logging improvement (#5387)
* Log aposResponse errors (#5386) * log aposResponse errors * add changeset --------- Co-authored-by: Harouna Traoré <haroun@users.noreply.github.com> * credit * beta --------- Co-authored-by: haroun <1765606+haroun@users.noreply.github.com> Co-authored-by: Harouna Traoré <haroun@users.noreply.github.com>
1 parent 96cf174 commit b8526bb

3 files changed

Lines changed: 11 additions & 2 deletions

File tree

‎packages/apostrophe-astro/CHANGELOG.md‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Changelog
22

3+
## 1.12.0-beta.1
4+
5+
### Minor Changes
6+
7+
- 557e8ea: Log `aposResponse` errors server side in the Astro process. Thanks to [Harouna Traore](https://github.com/haroun).
8+
39
## 1.11.0 (2026-04-15)
410

511
### Adds

‎packages/apostrophe-astro/lib/aposResponse.js‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ export default async function aposResponse(req) {
4949

5050
const aposUrl = new URL(aposHost + pathname);
5151
aposUrl.search = url.search;
52-
52+
5353
// Prepare headers, excluding any specified in config
5454
const requestHeaders = {};
5555
for (const [name, value] of req.headers) {
@@ -111,6 +111,7 @@ export default async function aposResponse(req) {
111111
}
112112
// Skip unknown encodings silently
113113
} catch (decompressError) {
114+
console.error(decompressError);
114115
// If decompression fails, return original response
115116
return new Response(new Uint8Array(bodyArrayBuffer), {
116117
...rest,
@@ -133,10 +134,12 @@ export default async function aposResponse(req) {
133134
headers: responseHeaders
134135
});
135136
} catch (bodyError) {
137+
console.error(bodyError);
136138
// If we can't process the body, fall back to the original response
137139
return new Response(res.body, { ...rest, status: statusCode, headers: responseHeaders });
138140
}
139141
} catch (error) {
142+
console.error(error);
140143
// Handle any unexpected errors
141144
return new Response(`Server error: ${error.message}`, { status: 500 });
142145
}

‎packages/apostrophe-astro/package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@apostrophecms/apostrophe-astro",
3-
"version": "1.11.0",
3+
"version": "1.12.0-beta.1",
44
"type": "module",
55
"description": "Apostrophe integration for Astro",
66
"repository": {

0 commit comments

Comments
 (0)