File tree Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Original file line number Diff line number Diff line change 63
63
// ErrWorkspaceLockedByRun is returned when trying to unlock a workspace locked by a run.
64
64
ErrWorkspaceLockedByRun = errors .New ("unable to unlock workspace locked by run" )
65
65
66
+ // ErrWorkspaceLockedByTeam is returned when trying to unlock a workspace locked by a team.
67
+ ErrWorkspaceLockedByTeam = errors .New ("unable to unlock workspace locked by team" )
68
+
69
+ // ErrWorkspaceLockedByUser is returned when trying to unlock a workspace locked by a user.
70
+ ErrWorkspaceLockedByUser = errors .New ("unable to unlock workspace locked by user" )
71
+
66
72
// ErrWorkspaceStillProcessing is returned when a workspace is still processing state
67
73
// to determine if it is safe to delete. "conflict" followed by newline is used to
68
74
// preserve go-tfe version compatibility with the error constructed at runtime before it was
Original file line number Diff line number Diff line change @@ -973,6 +973,14 @@ func checkResponseCode(r *http.Response) error {
973
973
return ErrWorkspaceLockedByRun
974
974
}
975
975
976
+ if errorPayloadContains (errs , "is locked by Team" ) {
977
+ return ErrWorkspaceLockedByTeam
978
+ }
979
+
980
+ if errorPayloadContains (errs , "is locked by User" ) {
981
+ return ErrWorkspaceLockedByUser
982
+ }
983
+
976
984
return ErrWorkspaceNotLocked
977
985
case strings .HasSuffix (r .Request .URL .Path , "actions/force-unlock" ):
978
986
return ErrWorkspaceNotLocked
You can’t perform that action at this time.
0 commit comments