@mastra/deployer 1.0.0-beta.15 → 1.0.0-beta.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,53 @@
1
1
  # @mastra/deployer
2
2
 
3
+ ## 1.0.0-beta.17
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [[`b5dc973`](https://github.com/mastra-ai/mastra/commit/b5dc9733a5158850298dfb103acb3babdba8a318)]:
8
+ - @mastra/core@1.0.0-beta.17
9
+ - @mastra/server@1.0.0-beta.17
10
+
11
+ ## 1.0.0-beta.16
12
+
13
+ ### Minor Changes
14
+
15
+ - Add `onError` hook to server configuration for custom error handling. ([#11403](https://github.com/mastra-ai/mastra/pull/11403))
16
+
17
+ You can now provide a custom error handler through the Mastra server config to catch errors, format responses, or send them to external services like Sentry:
18
+
19
+ ```typescript
20
+ import { Mastra } from '@mastra/core/mastra';
21
+
22
+ const mastra = new Mastra({
23
+ server: {
24
+ onError: (err, c) => {
25
+ // Send to Sentry
26
+ Sentry.captureException(err);
27
+
28
+ // Return custom formatted response
29
+ return c.json(
30
+ {
31
+ error: err.message,
32
+ timestamp: new Date().toISOString(),
33
+ },
34
+ 500,
35
+ );
36
+ },
37
+ },
38
+ });
39
+ ```
40
+
41
+ If no `onError` is provided, the default error handler is used.
42
+
43
+ Fixes #9610
44
+
45
+ ### Patch Changes
46
+
47
+ - Updated dependencies [[`3d93a15`](https://github.com/mastra-ai/mastra/commit/3d93a15796b158c617461c8b98bede476ebb43e2), [`efe406a`](https://github.com/mastra-ai/mastra/commit/efe406a1353c24993280ebc2ed61dd9f65b84b26), [`119e5c6`](https://github.com/mastra-ai/mastra/commit/119e5c65008f3e5cfca954eefc2eb85e3bf40da4), [`0ff9edd`](https://github.com/mastra-ai/mastra/commit/0ff9edda410f5eadb6e73f5cadc4bf82a51c3bce), [`74e504a`](https://github.com/mastra-ai/mastra/commit/74e504a3b584eafd2f198001c6a113bbec589fd3), [`e33fdbd`](https://github.com/mastra-ai/mastra/commit/e33fdbd07b33920d81e823122331b0c0bee0bb59), [`929f69c`](https://github.com/mastra-ai/mastra/commit/929f69c3436fa20dd0f0e2f7ebe8270bd82a1529), [`8a73529`](https://github.com/mastra-ai/mastra/commit/8a73529ca01187f604b1f3019d0a725ac63ae55f)]:
48
+ - @mastra/core@1.0.0-beta.16
49
+ - @mastra/server@1.0.0-beta.16
50
+
3
51
  ## 1.0.0-beta.15
4
52
 
5
53
  ### Patch Changes
@@ -3675,7 +3675,13 @@ async function createHonoServer(mastra, options = {
3675
3675
  customRouteAuthConfig.set(routeKey, requiresAuth);
3676
3676
  }
3677
3677
  }
3678
- app.onError((err, c) => errorHandler(err, c, options.isDev));
3678
+ const customOnError = server?.onError;
3679
+ app.onError((err, c) => {
3680
+ if (customOnError) {
3681
+ return customOnError(err, c);
3682
+ }
3683
+ return errorHandler(err, c, options.isDev);
3684
+ });
3679
3685
  const bodyLimitOptions = {
3680
3686
  maxSize: server?.bodySizeLimit ?? 4.5 * 1024 * 1024,
3681
3687
  // 4.5 MB,