Skip to content

Commit

Permalink
Merge 7a7c32d
Browse files Browse the repository at this point in the history
  • Loading branch information
noha committed May 25, 2019
2 parents 9b7bd22 + 7a7c32d commit 44ef6ec
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 5 deletions.
1 change: 0 additions & 1 deletion source/SnapDump-Core/SDSnapshot.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ Class {
#instVars : [
'id',
'timestamp',
'store',
'project',
'version',
'className',
Expand Down
5 changes: 2 additions & 3 deletions source/SnapDump-Handler/SDBasicHTTPStore.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ SDBasicHTTPStore >> writeSnapshot: snapshot [
url: (self urlForSnapshot: snapshot id);
entity: (ZnByteArrayEntity bytes: writeStream contents);
put
]
on: Error
do: [ :err | err pass. Transcript show: 'error happened: ', err description ]
] on: Error do: [ :err |
Transcript show: 'error happened: ', err description ]
]
15 changes: 15 additions & 0 deletions source/SnapDump-Server-Tests/SDHTTPTests.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,21 @@ SDHTTPTests >> tearDown [
server stop.
]

{ #category : #tests }
SDHTTPTests >> testInternalServerError [
| response snapshot |
server debugMode: false.
response := ZnClient new
url: self apiUri / #snapshots / self dummySnapshotId;
entity: (ZnStringEntity text: '{bogus ;json');
put;
response.
self assert: response isError.
self assert: rootPath hasFiles.
snapshot := SDFileSnapshot fromFile: rootPath children anyOne.
self assert: snapshot className equals: 'FLMaterializer'
]

{ #category : #tests }
SDHTTPTests >> testProject [
| response project |
Expand Down
9 changes: 8 additions & 1 deletion source/SnapDump-Server/SDServerDelegate.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,14 @@ Class {

{ #category : #'error handling' }
SDServerDelegate >> serverError: request exception: exception [
SnapDump handleException: exception.
| project version |
project := (SDProject name: 'SnapDump').
version := (SDVersion string: (SDServer version ifNil: [ 'N/A' ]))
project: project.
[ self store storeSnapshot: (exception asSnapshot
project: project;
version: version ) ]
on: Error do: [ :err | "nothing we can do here" ] .
^ super serverError: request exception: exception
]

Expand Down

0 comments on commit 44ef6ec

Please sign in to comment.