Skip to content

Commit 87b07c9

Browse files
authored
PRO-8348: hotfix (#5083) (#5085)
1 parent a1c999a commit 87b07c9

3 files changed

Lines changed: 19 additions & 5 deletions

File tree

CHANGELOG.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,6 @@
1313

1414
* Fixes a bug in the login `uponSubmit` filter where a user could login without meeting the requirement.
1515
* Fixes pieces filters when values from optional fields are falsy.
16-
17-
### Fixes
18-
1916
* Resolve inline image URLs correctly when in edit mode and not in the default locale.
2017
* Using `CTRL+F` or `CMD+F` in the page manager now works.
2118

@@ -26,6 +23,14 @@
2623
* Modifies the `annotateAreaForExternalFront()` method of the `@apostrophecms/template` module to accept a per-module `annotateWidgetForExternalFront()` method. This allows widgets to send project-level options alongside the per-area options to external frontends.
2724
* Updated dependencies to address deprecation warnings.
2825

26+
## 4.21.1 (2025-09-26)
27+
28+
### Adds
29+
30+
* The `exit` option to the main `apostrophe()` function now supports the new string value `exit: 'throw'`. If this value is specified and the apostrophe startup procedure fails with an error, the actual error is re-thrown for the benefit of the caller.
31+
* For backwards compatibility, the existing `exit: false` option to the main `apostrophe()` function is still supported, but now logs the error that took place before returning `undefined` as before. This is more useful than the previous behavior, but `exit: 'throw'` is the more logical choice if you need to avoid a process exit.
32+
* The default behavior is still to log the error and exit the process, which isthe only sensible move in most single-site projects.
33+
2934
## 4.21.0 (2025-09-03)
3035

3136
### Adds

index.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,16 @@ async function apostrophe(options, telemetry, rootSpan) {
350350

351351
return self;
352352
} catch (e) {
353-
if (options.exit !== false) {
353+
if (options.exit === false) {
354+
console.error('apostrophe: error occurred during startup, continuing:');
355+
console.error(e);
356+
// returns undefined, for legacy reasons
357+
} else if (options.exit === 'throw') {
358+
// A more sensible approach for those who want to do something
359+
// if initialization fails
360+
throw e;
361+
} else {
362+
// Longstanding default behavior
354363
console.error(e);
355364
await self._exit(1, e);
356365
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "apostrophe",
3-
"version": "4.21.0",
3+
"version": "4.21.1",
44
"description": "The Apostrophe Content Management System.",
55
"main": "index.js",
66
"scripts": {

0 commit comments

Comments
 (0)