[squeak-dev] The Inbox: HelpSystem-Core-ct.131.mcz

commits at source.squeak.org commits at source.squeak.org
Mon Mar 2 09:56:15 UTC 2020


Christoph Thiede uploaded a new version of HelpSystem-Core to project The Inbox:
http://source.squeak.org/inbox/HelpSystem-Core-ct.131.mcz

==================== Summary ====================

Name: HelpSystem-Core-ct.131
Author: ct
Time: 2 March 2020, 10:56:11.800949 am
UUID: 9b0d6d0c-a344-5648-9a03-7ac23afa7515
Ancestors: HelpSystem-Core-mt.119

Proposal: Make HtmlHelpTopic downloads more robust by retrying the download up to three times if the request was not successful.

=============== Diff against HelpSystem-Core-mt.119 ===============

Item was changed:
  ----- Method: HtmlHelpTopic>>document (in category 'accessing') -----
  document
  
+ 	| retriesRemaining |
+ 	document ifNotNil: [^ document].
+ 	retriesRemaining := 3.
+ 	^ document := [
- 	^ document ifNil: [document := 
  		[
+ 			| response |
+ 			response := WebClient new httpGet: self url do: [:req |
+ 				req headerAt: 'Accept' put: 'text/html'].
+ 			response isSuccess
+ 				ifFalse: [self error: #serverError].
+ 			response content
+ 		] on: Error do: [:err |
+ 			err messageText = #serverError
+ 				ifFalse: [err pass].
+ 			retriesRemaining strictlyPositive
+ 				ifFalse: [err ignore]
+ 				ifTrue: [
+ 					retriesRemaining := retriesRemaining - 1.
+ 					err retry]]
+ 	] on: Error do: [:err | err printString]!
- 			(HTTPSocket httpGet: self url accept: 'text/html') contents
- 		] on: Error do: [:err | err printString]]!



More information about the Squeak-dev mailing list