Skip to content

Commit

Permalink
Throw errors instead of silently ignoring decoding errors when loadin…
Browse files Browse the repository at this point in the history
…g snapshots and assets

Fixes #40.
  • Loading branch information
MariusDoe committed Nov 12, 2024
1 parent 58c2c97 commit f2e4bcd
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@ loadAssetFileFrom: aFileSystem
reference := self referenceIn: aFileSystem.
reference isFile ifFalse: [^ nil].
^ reference readStreamDo: [:stream |
(self canReadAssetFrom: stream) ifFalse: [^ nil].
self readAssetFrom: stream. "check for errors (will be thrown)"
stream reset.
GSAssetFile withMapper: self fromStream: stream]
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
"initialize" : "mad 9/20/2023 18:55",
"isValidAsset:" : "mad 9/29/2024 17:39",
"kind" : "mad 9/29/2024 19:28",
"loadAssetFileFrom:" : "mad 11/12/2024 19:00",
"loadAssetFileFrom:" : "mad 11/12/2024 19:10",
"loadAssetFileFromImage:" : "mad 9/29/2024 16:35",
"loadAssetFromImage:" : "mad 9/29/2024 17:42",
"mappedPathPatterns" : "mad 10/9/2024 16:01",
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
snapshot-creation
loadSnapshotFrom: aFilesystem
^ [(self readerOn: (self packageDirectoryIn: aFilesystem)) version snapshot]
on: self expectedReadErrorsOnMissingSnapshot
do: [^ MCSnapshot empty]
| directory |
directory := self packageDirectoryIn: aFilesystem.
directory isDirectory ifFalse: [^ MCSnapshot empty].
^ (self readerOn: directory) version snapshot
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,10 @@
"changeSetToMergeFSCommit:into:withBase:" : "mad 11/12/2024 15:23",
"cleanDirectory:" : "mad 10/9/2024 16:01",
"encodingName" : "mad 4/18/2024 18:11",
"expectedReadErrorsOnMissingSnapshot" : "mad 10/4/2024 19:56",
"hash" : "mad 9/13/2023 18:28",
"hexHashPath" : "mad 11/12/2024 14:51",
"initialize" : "mad 4/25/2023 19:41",
"loadSnapshotFrom:" : "mad 10/4/2024 19:59",
"loadSnapshotFrom:" : "mad 11/12/2024 14:03",
"mappedPathPatterns" : "mad 10/9/2024 16:01",
"operationFrom:to:" : "mad 8/13/2024 17:52",
"package" : "mad 4/21/2023 23:34",
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"encodingName" : "mad 4/18/2024 18:11",
"packageNameFromPackagePath:" : "mad 10/4/2024 16:29" },
"instance" : {
"expectedReadErrorsOnMissingSnapshot" : "mad 10/4/2024 19:56",
"packagePath" : "mad 4/29/2024 22:20",
"readerOn:" : "mad 10/4/2024 19:55",
"write:with:" : "mad 10/4/2024 20:03",
Expand Down

0 comments on commit f2e4bcd

Please sign in to comment.