Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bugs #21

Merged
merged 1 commit into from
Jul 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions src/Bloc-Serialization-STON/BlGridLayoutSpec.extension.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
Extension { #name : #BlGridLayoutSpec }

{ #category : #'*Bloc-Serialization-STON' }
BlGridLayoutSpec class >> fromSton: stonReader [
"Create a new instance and delegate decoding to instance side.
Override only when new instance should be created directly (see implementors). "

^ (self start: UNDEFINED)
fromSton: stonReader;
yourself
]
6 changes: 3 additions & 3 deletions src/Bloc-Serialization/TBlSerializer.trait.st
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Trait {
#name : #TBlSerializer,
#category : #'Bloc-Serialization'
#category : #'Bloc-Serialization-Core'
}

{ #category : #serialization }
Expand All @@ -9,7 +9,7 @@ TBlSerializer classSide >> materialize: aString [
| blElement |
aString isString not ifTrue:[ BlocMaterializationError signal: 'Cannot materialize a no String object into BlElement' ].
"Try to materialize and catch an error into a BlocMaterialization error"
[ blElement := STON fromString: aString ] onErrorDo: [ :e | BlocMaterializationError signal: 'Cannot support Bloc materialization of this String (', e asString, ')' ].
[ blElement := self materializeImplementation: aString ] onErrorDo: [ :e | BlocMaterializationError signal: 'Cannot support Bloc materialization of this String (', e asString, ')' ].
blElement ifNil:[ BlocMaterializationError signal: 'Bloc materialization result is nil' ].

^ blElement
Expand All @@ -25,7 +25,7 @@ TBlSerializer classSide >> serialize: aBlElementOrABlElementsCollection [
ifFalse: [ self verifyElement: aBlElementOrABlElementsCollection ].

"Try to serialize and catch an error into a BlocSerialization error"
[ string := STON toStringPretty: aBlElementOrABlElementsCollection ] onErrorDo: [ :e | BlocSerializationError signal: 'Cannot support serialization of this BlElement (', e asString, ')' ].
[ string := self serializeImplementation: aBlElementOrABlElementsCollection ] onErrorDo: [ :e | BlocSerializationError signal: 'Cannot support serialization of this BlElement (', e asString, ')' ].

^ string
]
Expand Down
Loading