@crombolo/data 0.55.0 → 0.56.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@crombolo/data",
3
- "version": "0.55.0",
3
+ "version": "0.56.0",
4
4
  "description": "Internal to crombolo, with no compatibility promise: use @crombolo/crombolo. SQLite and Postgres storage for crombolo: schema, migrations and repositories.",
5
5
  "license": "MIT",
6
6
  "author": "Crombolo",
@@ -28,7 +28,7 @@
28
28
  "access": "public"
29
29
  },
30
30
  "dependencies": {
31
- "@crombolo/core": "0.55.0",
31
+ "@crombolo/core": "0.56.0",
32
32
  "kysely": "0.29.6"
33
33
  }
34
34
  }
@@ -227,7 +227,15 @@ export interface DocumentRepositoryOptions {
227
227
  }
228
228
 
229
229
  /** Thrown when a publish is refused by a business rule rather than failing. */
230
- export class PublishBlockedError extends Error {}
230
+ export class PublishBlockedError extends Error {
231
+ /** The properties that stopped it, when it was their values (story 298). */
232
+ readonly errors: DocumentValidationError[]
233
+
234
+ constructor(message: string, errors: DocumentValidationError[] = []) {
235
+ super(message)
236
+ this.errors = errors
237
+ }
238
+ }
231
239
 
232
240
  /** The parent named for a new item is gone, or in the recycle bin. */
233
241
  export class InvalidParentError extends Error {}
@@ -2659,6 +2667,7 @@ export class DocumentRepository {
2659
2667
  )
2660
2668
  throw new PublishBlockedError(
2661
2669
  `Required: ${[...new Set(names)].join(', ')} must have a value before publishing.`,
2670
+ errors,
2662
2671
  )
2663
2672
  }
2664
2673
  }