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

Improve Exception Handling #93

Merged
merged 5 commits into from
Jun 20, 2021
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
behaviour
pause

super pause.
ATDDBrowser changedGitHubActions
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"symbol" : "sw 5/25/2021 22:27" },
"instance" : {
"initialize" : "BF 5/23/2021 21:18",
"pause" : "ng 6/18/2021 14:47",
"repositoryURL:" : "BF 5/23/2021 21:29",
"statusChanged" : "ClassTest 5/29/2021 19:31",
"updateStatus" : "ClassTest 5/28/2021 23:47" } }

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ requestOn: aString
response content; close ]
on: Error
do: [ :error |
[ GHAConnectionError signal: 'Connection failed: ' , error messageText ] fork.
[ ATDDConnectionError signal: 'Connection failed: ' , error messageText ] fork.
^ JsonObject new ].
^ response code
= 200
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,11 @@
"class" : {
},
"instance" : {
"errorDictionary" : "ng 5/26/2021 19:13",
"getJsonForJobsForRepository:forWorkflowRunId:" : "BF 5/23/2021 21:30",
"getJsonForLatestWorkflowRunForRepository:" : "ng 5/27/2021 19:07",
"getJsonForWorkflow:" : "ng 5/23/2021 12:08",
"getJsonForWorkflowRunsForRepository:" : "ng 5/22/2021 19:16",
"getLogsForRepository:logId:" : "ng 5/27/2021 19:07",
"gitHubActionsApiUrl" : "ng 5/14/2021 16:07",
"mimeType" : "ng 5/14/2021 15:45",
"requestOn:" : "BF 5/28/2021 21:36",
"throwExceptionForResponseCode:" : "ng 5/26/2021 19:14" } }
"requestOn:" : "ng 6/18/2021 14:04" } }
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
accessing
errorDictionary

^ IdentityDictionary newFrom: {
401 -> ATDDConnectionError.
403 -> ATDDAccessDeniedError.
404 -> ATDDNotFoundError
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
"class" : {
},
"instance" : {
"errorDictionary" : "ng 6/18/2021 14:48",
"throwExceptionForResponseCode:" : "ng 6/18/2021 14:05",
"token" : "ClassTest 6/2/2021 18:44",
"token:" : "ClassTest 6/2/2021 18:44",
"userAgent" : "ClassTest 6/2/2021 18:45",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,4 @@ behaviour
pause

self terminateProcess.
super pause.
self updateStatus
super pause
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"internalStatus" : "ClassTest 6/2/2021 17:54",
"internalStatus:" : "ClassTest 5/29/2021 19:42",
"newRefreshProcess" : "sw 5/28/2021 18:04",
"pause" : "sw 5/28/2021 18:04",
"pause" : "ng 6/18/2021 14:46",
"pausedString" : "sw 5/28/2021 18:04",
"process" : "sw 5/28/2021 18:06",
"process:" : "sw 5/28/2021 18:06",
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ requestOn: aString
response content; close ]
on: Error
do: [ :error |
[ TCIConnectionError signal: 'Connection failed: ' , error messageText ] fork.
[ ATDDConnectionError signal: 'Connection failed: ' , error messageText ] fork.
^ JsonObject new ].

^ response code
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
"class" : {
},
"instance" : {
"errorDictionary" : "PS 7/25/2014 17:01",
"getJsonForBuild:" : "CW 2/25/2016 10:14",
"getJsonForBuildsOfRepository:" : "PS 5/19/2014 17:44",
"getJsonForJob:" : "PS 5/19/2014 14:40",
Expand All @@ -12,8 +11,7 @@
"isJson:" : "PS 6/11/2014 13:56",
"mimeType" : "PS 5/18/2014 18:04",
"requestAPIOn:" : "maf 12/5/2017 14:41",
"requestOn:" : "ls 7/25/2019 15:30",
"throwExceptionForResponseCode:" : "PS 6/23/2014 15:55",
"requestOn:" : "ng 6/18/2021 14:04",
"travisApiUrl" : "PS 6/19/2014 09:57",
"usePro" : "PS 6/19/2014 09:56",
"usePro:" : "ls 7/25/2019 15:20" } }
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
data-processing
validate: aString

(aString matchesRegex: self class validSlug) ifFalse: [ TCINoValidSlugError signal ]
(aString matchesRegex: self class validSlug) ifFalse: [ ATDDNoValidSlugError signal ]
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,5 @@
"update" : "ls 7/11/2019 18:57",
"usePro" : "ls 6/5/2019 21:10",
"usePro:" : "ls 7/25/2019 14:13",
"validate:" : "vxr 7/4/2019 14:25",
"validate:" : "ng 6/18/2021 14:06",
"wrapAsJson:" : "vxr 7/4/2019 14:25" } }
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
behaviour
pause

super pause.
ATDDBrowser changedTravisStatuses
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"symbol" : "sw 5/25/2021 22:21" },
"instance" : {
"initialize" : "BF 5/23/2021 21:18",
"pause" : "ng 6/18/2021 14:49",
"repositoryURL:" : "ls 7/25/2019 09:23",
"statusChanged" : "ClassTest 5/29/2021 19:36",
"updateStatus" : "ClassTest 5/28/2021 23:46",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
An ATDDAccessDeniedError is thrown when the HTTP request results in a 403 (Forbidden) Error.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
accessing
accessDeniedMessage
message

^ 'Access denied'
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
accessing
rateLimitMessage

^ 'You have been rate-limited. This GitHub Action will now be paused. Consider providing a token to prevent this.'
Benjamin-Frost marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
priv handling
defaultAction

^ Transcript show: self class message
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"class" : {
"message" : "ng 6/18/2021 13:55",
"rateLimitMessage" : "BF 6/18/2021 14:51" },
"instance" : {
"defaultAction" : "ng 6/18/2021 13:53" } }
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
],
"classvars" : [
],
"commentStamp" : "ng 5/28/2021 14:44",
"commentStamp" : "BF 6/19/2021 10:35",
"instvars" : [
],
"name" : "GHAAccessDeniedError",
"name" : "ATDDAccessDeniedError",
"pools" : [
],
"super" : "Error",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
An ATDDConnectionError is thrown when the HTTP request results in a 401 (Unauthorized) Error.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"class" : {
},
"instance" : {
"defaultAction" : "ng 6/18/2021 14:03" } }
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
],
"classvars" : [
],
"commentStamp" : "be 7/25/2019 10:29",
"commentStamp" : "BF 6/19/2021 10:35",
"instvars" : [
],
"name" : "TCINoValidSlugError",
"name" : "ATDDConnectionError",
"pools" : [
],
"super" : "Error",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"commentStamp" : "be 7/25/2019 10:29",
"instvars" : [
],
"name" : "TCIAccessDeniedError",
"name" : "ATDDNoValidSlugError",
"pools" : [
],
"super" : "Error",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
An ATDDNotFoundError is thrown when the HTTP request results in a 404 (Not Found) Error.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
accessing
message

^ 'Not Found'
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
priv handling
defaultAction

^ Transcript show: self class message
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"class" : {
"message" : "ng 6/18/2021 13:55" },
"instance" : {
"defaultAction" : "ng 6/18/2021 13:59" } }
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
],
"classvars" : [
],
"commentStamp" : "ng 5/28/2021 14:45",
"commentStamp" : "BF 6/19/2021 10:36",
"instvars" : [
],
"name" : "GHAConnectionError",
"name" : "ATDDNotFoundError",
"pools" : [
],
"super" : "Error",
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
action
refreshGitHubAction: aGitHubAction

aGitHubAction refresh
[ aGitHubAction refresh ]
on: ATDDAccessDeniedError
do: [
UIManager default inform: ATDDAccessDeniedError rateLimitMessage.
self pauseTestingEntity: aGitHubAction
]
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
action
resumeGitHubAction: aGitHubAction

aGitHubAction resume
[ aGitHubAction resume ]
on: ATDDAccessDeniedError
do: [
UIManager default inform: ATDDAccessDeniedError rateLimitMessage.
self pauseTestingEntity: aGitHubAction
]
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
"pauseTestingEntity:" : "sw 5/28/2021 15:17",
"pauseTravisStatuses" : "sw 5/26/2021 00:03",
"pauseWatchers" : "sw 5/26/2021 00:04",
"refreshGitHubAction:" : "sw 5/21/2021 21:01",
"refreshGitHubAction:" : "BF 6/18/2021 14:51",
"refreshSelectedGitHubActions" : "sw 5/21/2021 21:02",
"refreshSelectedTravisStatuses" : "swi 7/10/2019 14:03",
"refreshTravisStatus:" : "swi 7/10/2019 14:03",
Expand All @@ -93,7 +93,7 @@
"resultsTravisStatuses" : "sw 5/26/2021 00:07",
"resultsWatchers" : "sw 5/26/2021 00:07",
"resumeAll" : "sw 5/21/2021 21:05",
"resumeGitHubAction:" : "sw 5/21/2021 21:04",
"resumeGitHubAction:" : "BF 6/18/2021 14:51",
"resumeSelectedGitHubActions" : "sw 5/21/2021 22:17",
"resumeSelectedTravisStatuses" : "swi 7/25/2019 15:30",
"resumeSelectedWatchers" : "swi 7/25/2019 15:31",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,6 @@ applyChanges

super applyChanges.

self gitHubAction resume
[ self gitHubAction resume ]
on: ATDDAccessDeniedError
do: [ self gitHubAction pause ]
Loading