-
Notifications
You must be signed in to change notification settings - Fork 32
Expand file tree
/
Copy patherrors.go
More file actions
1610 lines (1359 loc) · 57.7 KB
/
errors.go
File metadata and controls
1610 lines (1359 loc) · 57.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// Copyright 2022-2025 Salesforce, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package slackerror
import (
"fmt"
"path/filepath"
"strings"
"github.com/slackapi/slack-cli/internal/style"
)
const (
ErrAccessDenied = "access_denied"
ErrAddAppToProject = "add_app_to_project_error"
ErrAlreadyLoggedOut = "already_logged_out"
ErrAlreadyResolved = "already_resolved"
ErrAppsList = "apps_list_error"
ErrAppAdd = "app_add_error"
ErrAppApprovalRequestDenied = "app_approval_request_denied"
ErrAppApprovalRequestEligible = "app_approval_request_eligible"
ErrAppApprovalRequestPending = "app_approval_request_pending"
ErrAppAuthTeamMismatch = "app_auth_team_mismatch"
ErrAppCreate = "app_create_error"
ErrAppDelete = "app_delete_error"
ErrAppDeploy = "app_deploy_error"
ErrAppDeployNotSlackHosted = "app_deploy_function_runtime_not_slack"
ErrAppDirectoryAccess = "app_directory_access_error"
ErrAppDirOnlyFail = "app_dir_only_fail"
ErrAppExists = "app_add_exists"
ErrAppFlagRequired = "app_flag_required"
ErrAppFound = "app_found"
ErrAppHosted = "app_hosted"
ErrAppInstall = "app_install_error"
ErrAppManifestAccess = "app_manifest_access_error"
ErrAppManifestCreate = "app_manifest_create_error"
ErrAppManifestGenerate = "app_manifest_generate_error"
ErrAppManifestUpdate = "app_manifest_update_error"
ErrAppManifestValidate = "app_manifest_validate_error"
ErrAppNotEligible = "app_not_eligible"
ErrAppNotInstalled = "app_not_installed"
ErrAppNotFound = "app_not_found"
ErrAppNotHosted = "app_not_hosted"
ErrAppRemove = "app_remove_error"
ErrAppRenameApp = "app_rename_app"
ErrAuthProdTokenNotFound = "auth_prod_token_not_found"
ErrAuthTimeout = "auth_timeout_error"
ErrAuthToken = "auth_token_error"
ErrAuthVerification = "auth_verification_error"
ErrBotInviteRequired = "bot_invite_required" // Slack API error code
ErrCannotAbandonApp = "cannot_abandon_app"
ErrCannotAddOwner = "cannot_add_owner"
ErrCannotCountOwners = "cannot_count_owners"
ErrCannotDeleteApp = "cannot_delete_app"
ErrCannotListCollaborators = "cannot_list_collaborators"
ErrCannotListOwners = "cannot_list_owners"
ErrCannotRemoveCollaborators = "cannot_remove_collaborators"
ErrCannotRemoveOwners = "cannot_remove_owner"
ErrCannotRevokeOrgBotToken = "cannot_revoke_org_bot_token"
ErrConnectorApprovalPending = "connector_approval_pending"
ErrConnectorApprovalRequired = "connector_approval_required"
ErrConnectorDenied = "connector_denied"
ErrConnectorNotInstalled = "connector_not_installed"
ErrChannelNotFound = "channel_not_found"
ErrCLIAutoUpdate = "cli_autoupdate_error"
ErrCLIConfigLocationError = "cli_config_location_error"
ErrCLIConfigInvalid = "cli_config_invalid"
ErrCLIReadError = "cli_read_error"
ErrCLIUpdateRequired = "cli_update_required" // Slack API error code
ErrCommentRequired = "comment_required"
ErrConnectedOrgDenied = "connected_org_denied"
ErrConnectedTeamDenied = "connected_team_denied"
ErrContextValueNotFound = "context_value_not_found"
ErrCredentialsNotFound = "credentials_not_found"
ErrCustomizableInputMissingMatchingWorkflowInput = "customizable_input_missing_matching_workflow_input"
ErrCustomizableInputsNotAllowedOnOptionalInputs = "customizable_inputs_not_allowed_on_optional_inputs"
ErrCustomizableInputsOnlyAllowedOnLinkTriggers = "customizable_inputs_only_allowed_on_link_triggers"
ErrCustomizableInputUnsupportedType = "customizable_input_unsupported_type"
ErrDatastore = "datastore_error"
ErrDatastoreMissingPrimaryKey = "datastore_missing_primary_key"
ErrDatastoreNotFound = "datastore_not_found"
ErrDefaultAppAccess = "default_app_access_error"
ErrDefaultAppSetting = "default_app_setting_error"
ErrDenoNotFound = "deno_not_found"
ErrDeployedAppNotSupported = "deployed_app_not_supported"
ErrDocumentationGenerationFailed = "documentation_generation_failed"
ErrEnterpriseNotFound = "enterprise_not_found"
ErrFailedAddingCollaborator = "failed_adding_collaborator"
ErrFailedCreatingApp = "failed_creating_app"
ErrFailedDatastoreOperation = "failed_datastore_operation"
ErrFailedExport = "failed_export"
ErrFailForSomeRequests = "failed_for_some_requests"
ErrFailedToGetUser = "failed_to_get_user"
ErrFailedToSaveExtensionLogs = "failed_to_save_extension_logs"
ErrFailToGetTeamsForRestrictedUser = "fail_to_get_teams_for_restricted_user"
ErrFeedbackNameInvalid = "feedback_name_invalid"
ErrFeedbackNameRequired = "feedback_name_required"
ErrFileRejected = "file_rejected"
ErrForbiddenTeam = "forbidden_team"
ErrFreeTeamNotAllowed = "free_team_not_allowed"
ErrFunctionBelongsToAnotherApp = "function_belongs_to_another_app"
ErrFunctionNotFound = "function_not_found"
ErrGitNotFound = "git_not_found"
ErrGitClone = "git_clone_error"
ErrGitZipDownload = "git_zip_download_error"
ErrHomeDirectoryAccessFailed = "home_directory_access_failed"
ErrHooksJSONLocation = "hooks_json_location_error"
ErrHostAppsDisallowUserScopes = "hosted_apps_disallow_user_scopes"
ErrHTTPRequestFailed = "http_request_failed"
ErrHTTPResponseInvalid = "http_response_invalid"
ErrInsecureRequest = "insecure_request"
ErrInstallationDenied = "installation_denied"
ErrInstallationFailed = "installation_failed"
ErrInstallationRequired = "installation_required"
ErrInternal = "internal_error"
ErrInvalidApp = "invalid_app"
ErrInvalidAppDirectory = "invalid_app_directory"
ErrInvalidAppFlag = "invalid_app_flag"
ErrInvalidAppID = "invalid_app_id"
ErrInvalidArgs = "invalid_args"
ErrInvalidArgumentsCustomizableInputs = "invalid_arguments_customizable_inputs"
ErrInvalidArguments = "invalid_arguments"
ErrInvalidAuth = "invalid_auth"
ErrInvalidChallenge = "invalid_challenge"
ErrInvalidChannelID = "invalid_channel_id"
ErrInvalidCursor = "invalid_cursor"
ErrInvalidDistributionType = "invalid_distribution_type"
ErrInvalidFlag = "invalid_flag"
ErrInvalidInteractiveTriggerInputs = "invalid_interactive_trigger_inputs"
ErrInvalidManifest = "invalid_manifest"
ErrInvalidManifestSource = "invalid_manifest_source"
ErrInvalidParameters = "invalid_parameters"
ErrInvalidPermissionType = "invalid_permission_type"
ErrInvalidRefreshToken = "invalid_refresh_token"
ErrInvalidRequestID = "invalid_request_id"
ErrInvalidResourceID = "invalid_resource_id"
ErrInvalidResourceType = "invalid_resource_type"
ErrInvalidS3Key = "invalid_s3_key"
ErrInvalidScopes = "invalid_scopes"
ErrInvalidSemVer = "invalid_semver"
ErrInvalidSlackProjectDirectory = "invalid_slack_project_directory"
ErrInvalidDatastore = "invalid_datastore"
ErrInvalidDatastoreExpression = "invalid_datastore_expression"
ErrInvalidToken = "invalid_token"
ErrInvalidTrigger = "invalid_trigger"
ErrInvalidTriggerAccess = "invalid_trigger_access"
ErrInvalidTriggerConfig = "invalid_trigger_config"
ErrInvalidTriggerEventType = "invalid_trigger_event_type"
ErrInvalidTriggerInputs = "invalid_trigger_inputs"
ErrInvalidTriggerType = "invalid_trigger_type"
ErrInvalidUserID = "invalid_user_id"
ErrInvalidWebhookConfig = "invalid_webhook_config"
ErrInvalidWebhookSchemaRef = "invalid_webhook_schema_ref"
ErrInvalidWorkflowAppID = "invalid_workflow_app_id"
ErrInvalidWorkflowID = "invalid_workflow_id"
ErrIsRestricted = "is_restricted"
ErrLocalAppNotFound = "local_app_not_found"
ErrLocalAppNotSupported = "local_app_not_supported"
ErrLocalAppRemoval = "local_app_removal_error"
ErrLocalAppRun = "local_app_run_error"
ErrLocalAppRunCleanExit = "local_app_run_clean_exit"
ErrMethodNotSupported = "method_not_supported"
ErrMismatchedFlags = "mismatched_flags"
ErrMissingAppID = "missing_app_id"
ErrMissingAppTeamID = "missing_app_team_id"
ErrMissingChallenge = "missing_challenge"
ErrMissingExperiment = "missing_experiment"
ErrMissingExtension = "missing_extension"
ErrMissingFunctionIdentifier = "missing_function_identifier"
ErrMissingFlag = "missing_flag"
ErrMissingInput = "missing_input"
ErrMissingOptions = "missing_options"
ErrMissingScope = "missing_scope"
ErrMissingScopes = "missing_scopes"
ErrMissingUser = "missing_user"
ErrMissingValue = "missing_value"
ErrNotAuthed = "not_authed"
ErrNotBearerToken = "not_bearer_token"
ErrNotFound = "not_found"
ErrNoFile = "no_file"
ErrNoPendingRequest = "no_pending_request"
ErrNoPermission = "no_permission"
ErrNoTokenFound = "no_token_found"
ErrNoTriggers = "no_triggers"
ErrNoValidNamedEntities = "no_valid_named_entities"
ErrOrgNotConnected = "org_not_connected"
ErrOrgNotFound = "org_not_found"
ErrOrgGrantExists = "org_grant_exists"
ErrOSNotSupported = "os_not_supported"
ErrOverResourceLimit = "over_resource_limit"
ErrParameterValidationFailed = "parameter_validation_failed"
ErrProcessInterrupted = "process_interrupted"
ErrProjectCompilation = "project_compilation_error"
ErrProjectConfigIDNotFound = "project_config_id_not_found"
ErrProjectConfigManifestSource = "project_config_manifest_source_error"
ErrProjectFileUpdate = "project_file_update_error"
ErrProviderNotFound = "provider_not_found"
ErrPrompt = "prompt_error"
ErrPublishedAppOnly = "published_app_only"
ErrRequestIDOrAppIDIsRequired = "request_id_or_app_id_is_required"
ErrRatelimited = "ratelimited"
ErrRestrictedPlanLevel = "restricted_plan_level"
ErrRuntimeNotFound = "runtime_not_found"
ErrRuntimeNotSupported = "runtime_not_supported"
ErrSDKConfigLoad = "sdk_config_load_error"
ErrSDKHookInvocationFailed = "sdk_hook_invocation_failed"
ErrSDKHookNotFound = "sdk_hook_not_found"
ErrSampleCreate = "sample_create_error"
ErrServiceLimitsExceeded = "service_limits_exceeded"
ErrSharedChannelDenied = "shared_channel_denied"
ErrSlackAuth = "slack_auth_error"
ErrSlackJSONLocation = "slack_json_location_error"
ErrSlackSlackJSONLocation = "slack_slack_json_location_error"
ErrSocketConnection = "socket_connection_error"
ErrScopesExceedAppConfig = "scopes_exceed_app_config"
ErrStreamingActivityLogs = "streaming_activity_logs_error"
ErrSurveyConfigNotFound = "survey_config_not_found"
ErrSystemConfigIDNotFound = "system_config_id_not_found"
ErrSystemRequirementsFailed = "system_requirements_failed"
ErrTeamAccessNotGranted = "team_access_not_granted"
ErrTeamFlagRequired = "team_flag_required"
ErrTeamList = "team_list_error"
ErrTeamNotConnected = "team_not_connected"
ErrTeamNotFound = "team_not_found"
ErrTeamNotOnEnterprise = "team_not_on_enterprise"
ErrTeamQuotaExceeded = "team_quota_exceeded"
ErrTemplatePathNotFound = "template_path_not_found"
ErrTokenExpired = "token_expired"
ErrTokenRevoked = "token_revoked"
ErrTokenRotation = "token_rotation_error"
ErrTooManyCustomizableInputs = "too_many_customizable_inputs"
ErrTooManyIdsProvided = "too_many_ids_provided"
ErrTooManyNamedEntities = "too_many_named_entities"
ErrTriggerCreate = "trigger_create_error"
ErrTriggerDelete = "trigger_delete_error"
ErrTriggerDoesNotExist = "trigger_does_not_exist"
ErrTriggerNotFound = "trigger_not_found"
ErrTriggerUpdate = "trigger_update_error"
ErrUnableToDelete = "unable_to_delete"
ErrUnableToOpenFile = "unable_to_open_file"
ErrUnableToParseJSON = "unable_to_parse_json"
ErrUninstallHalted = "uninstall_halted"
ErrUnknownFileType = "unknown_file_type"
ErrUnknownFunctionID = "unknown_function_id"
ErrUnknownMethod = "unknown_method"
ErrUnknownWebhookSchemaRef = "unknown_webhook_schema_ref"
ErrUnknownWorkflowID = "unknown_workflow_id"
ErrUntrustedSource = "untrusted_source"
ErrUnsupportedFileName = "unsupported_file_name"
ErrUserAlreadyOwner = "user_already_owner"
ErrUserAlreadyRequested = "user_already_requested"
ErrUserCannotManageApp = "user_cannot_manage_app"
ErrUserIDIsRequired = "user_id_is_required"
ErrUserNotFound = "user_not_found"
ErrUserRemovedFromTeam = "user_removed_from_team"
ErrWorkflowNotFound = "workflow_not_found"
ErrYaml = "yaml_error"
)
var ErrorCodeMap = map[string]Error{
ErrAccessDenied: {
Code: ErrAccessDenied,
Message: "You don't have the permission to access the specified resource",
Remediation: "Check with your Slack admin to make sure that you have permission to access the resource.",
},
ErrAddAppToProject: {
Code: ErrAddAppToProject,
Message: "Couldn't save your app's info to this project",
},
ErrAlreadyLoggedOut: {
Code: ErrAlreadyLoggedOut,
Message: "You're already logged out",
},
ErrAlreadyResolved: {
Code: ErrAlreadyResolved,
Message: "The app already has a resolution and cannot be requested",
},
ErrAppsList: {
Code: ErrAppsList,
Message: "Couldn't get a list of your apps",
},
ErrAppAdd: {
Code: ErrAppAdd,
Message: "Couldn't create a new app",
},
ErrAppApprovalRequestDenied: {
Code: ErrAppApprovalRequestDenied,
Message: "This app is currently denied for installation",
Remediation: "Reach out to an admin for additional information, or try requesting again with different scopes and outgoing domains",
},
ErrAppApprovalRequestEligible: {
Code: ErrAppApprovalRequestEligible,
Message: "This app requires permissions that must be reviewed by an admin before you can install it",
},
ErrAppApprovalRequestPending: {
Code: ErrAppApprovalRequestPending,
Message: "This app has requested admin approval to install and is awaiting review",
Remediation: "Reach out to an admin for additional information",
},
ErrAppAuthTeamMismatch: {
Code: ErrAppAuthTeamMismatch,
Message: "Specified app and team are mismatched",
Remediation: "Try a different combination of `--app` and `--team` flags",
},
ErrAppCreate: {
Code: ErrAppCreate,
Message: "Couldn't create your app",
},
ErrAppDelete: {
Code: ErrAppDelete,
Message: "Couldn't delete your app",
},
ErrAppDeploy: {
Code: ErrAppDeploy,
Message: "Couldn't deploy your app",
},
ErrAppDeployNotSlackHosted: {
Code: ErrAppDeployNotSlackHosted,
Message: "Deployment to Slack is not currently supported for apps with `runOnSlack` set as false",
Details: ErrorDetails{
ErrorDetail{Message: "Deployment to Slack is currently supported for apps written with the Deno Slack SDK."},
},
Remediation: fmt.Sprintf(`Learn about building apps with the Deno Slack SDK:
https://docs.slack.dev/tools/deno-slack-sdk
If you are using a Bolt framework, add a deploy hook then run: %s
Otherwise start your app for local development with: %s`,
style.Commandf("deploy", true),
style.Commandf("run", true),
),
},
ErrAppDirectoryAccess: {
Code: ErrAppDirectoryAccess,
Message: "Couldn't access app directory",
},
ErrAppDirOnlyFail: {
Code: ErrAppDirOnlyFail,
Message: "The app was neither in the app directory nor created on this team/org, and cannot be requested",
},
ErrAppExists: {
Code: ErrAppExists,
Message: "App already exists belonging to the team",
},
ErrAppFlagRequired: {
Code: ErrAppFlagRequired,
Message: "The --app flag must be provided",
Remediation: "Choose a specific app with `--app <app_id>`",
},
ErrAppFound: {
Code: ErrAppFound,
Message: "An app was found",
},
ErrAppHosted: {
Code: ErrAppHosted,
Message: "App is configured for Run on Slack infrastructure",
},
ErrAppInstall: {
Code: ErrAppInstall,
Message: "Couldn't install your app to a workspace",
},
ErrAppManifestAccess: {
Code: ErrAppManifestAccess,
Message: "Couldn't access your app manifest",
},
ErrAppManifestCreate: {
Code: ErrAppManifestCreate,
Message: "Couldn't create your app manifest",
},
ErrAppManifestGenerate: {
Code: ErrAppManifestGenerate,
Message: "Couldn't generate an app manifest from this project",
Remediation: "Check to make sure you are in a valid Slack project directory and that your project has no compilation errors.",
},
ErrAppManifestUpdate: {
Code: ErrAppManifestUpdate,
Message: "The app manifest was not updated",
},
ErrAppManifestValidate: {
Code: ErrAppManifestValidate,
Message: "Your app manifest is invalid",
},
ErrAppNotEligible: {
Code: ErrAppNotEligible,
Message: "The specified app is not eligible for this API",
},
ErrAppNotInstalled: {
Code: ErrAppNotInstalled,
Message: "The provided app must be installed on this team",
},
ErrAppNotFound: {
Code: ErrAppNotFound,
Message: "The app was not found",
},
ErrAppNotHosted: {
Code: ErrAppNotHosted,
Message: "App is not configured to be deployed to the Slack platform",
Remediation: strings.Join([]string{
"Deploy an app containing workflow automations to Slack managed infrastructure",
"Read about ROSI: https://docs.slack.dev/workflows/run-on-slack-infrastructure",
}, "\n"),
},
ErrAppRemove: {
Code: ErrAppRemove,
Message: "Couldn't remove your app",
},
ErrAppRenameApp: {
Code: ErrAppRenameApp,
Message: "Couldn't rename your app",
},
ErrAuthProdTokenNotFound: {
Code: ErrAuthProdTokenNotFound,
Message: "Couldn't find a valid auth token for the Slack API",
Remediation: fmt.Sprintf(
"You need to be logged in to at least 1 production (slack.com) team to use this command. Log into one with the %s command and try again.",
style.Commandf("login", false),
),
},
ErrAuthTimeout: {
Code: ErrAuthTimeout,
Message: "Couldn't receive authorization in the time allowed",
Remediation: "Ensure you have pasted the command in a Slack workspace and accepted the permissions.",
},
ErrAuthToken: {
Code: ErrAuthToken,
Message: "Couldn't get a token with an active session",
},
ErrCannotAbandonApp: {
Code: ErrCannotAbandonApp,
Message: "The last owner cannot be removed",
},
ErrCannotAddOwner: {
Code: ErrCannotAddOwner,
Message: "Unable to add the given user as owner",
},
ErrCannotCountOwners: {
Code: ErrCannotCountOwners,
Message: "Unable to retrieve current app collaborators",
},
ErrConnectorApprovalPending: {
Code: ErrConnectorApprovalPending,
Message: "A connector requires admin approval before it can be installed\nApproval is pending review",
Remediation: "Contact your Slack admin about the status of your request",
},
ErrConnectorApprovalRequired: {
Code: ErrConnectorApprovalRequired,
Message: "A connector requires admin approval before it can be installed",
Remediation: "Request approval for the given connector from your Slack admin",
},
ErrConnectorDenied: {
Code: ErrConnectorDenied,
Message: "A connector has been denied for use by an admin",
Remediation: "Contact your Slack admin",
},
ErrConnectorNotInstalled: {
Code: ErrConnectorNotInstalled,
Message: "A connector requires installation before it can be used",
Remediation: "Request installation for the given connector",
},
ErrAuthVerification: {
Code: ErrAuthVerification,
Message: "Couldn't verify your authorization",
},
ErrBotInviteRequired: {
Code: ErrBotInviteRequired,
Message: "Your app must be invited to the channel",
Remediation: "Try to find the channel declared the source code of a workflow or function.\n\nOpen Slack, join the channel, invite your app, and try the command again.\nLearn more: https://slack.com/help/articles/201980108-Add-people-to-a-channel",
},
ErrCannotDeleteApp: {
Code: ErrCannotDeleteApp,
Message: "Unable to delete app",
},
ErrCannotListCollaborators: {
Code: ErrCannotListCollaborators,
Message: "Calling user is unable to list collaborators",
},
ErrCannotListOwners: {
Code: ErrCannotListOwners,
Message: "Calling user is unable to list owners",
},
ErrCannotRemoveCollaborators: {
Code: ErrCannotRemoveCollaborators,
Message: "User is unable to remove collaborators",
},
ErrCannotRemoveOwners: {
Code: ErrCannotRemoveOwners,
Message: "Unable to remove the given user",
},
ErrCannotRevokeOrgBotToken: {
Code: ErrCannotRevokeOrgBotToken,
Message: "Revoking org-level bot token is not supported",
},
ErrChannelNotFound: {
Code: ErrChannelNotFound,
Message: "Couldn't find the specified Slack channel",
Remediation: "Try adding your app as a member to the channel.",
},
ErrCLIAutoUpdate: {
Code: ErrCLIAutoUpdate,
Message: "Couldn't auto-update this command-line tool",
Remediation: "You can manually install the latest version from:\nhttps://docs.slack.dev/tools/slack-cli",
},
ErrCLIConfigLocationError: {
Code: ErrCLIConfigLocationError,
Message: fmt.Sprintf("The %s configuration file is not supported", filepath.Join(".slack", "cli.json")),
Remediation: strings.Join([]string{
"This version of the CLI no longer supports this configuration file.",
fmt.Sprintf("Move the %s file to %s and try again.", filepath.Join(".slack", "cli.json"), filepath.Join(".slack", "hooks.json")),
}, "\n"),
},
ErrCLIReadError: {
Code: ErrCLIReadError,
Message: "There was an error reading configuration",
Remediation: "Check your config.json file.",
},
ErrCLIConfigInvalid: {
Code: ErrCLIConfigInvalid,
Message: "Configuration invalid",
Remediation: "Check your config.json file.",
},
ErrCLIUpdateRequired: {
Code: ErrCLIUpdateRequired,
Message: "Slack API requires the latest version of the Slack CLI",
Remediation: fmt.Sprintf("You can upgrade to the latest version of the Slack CLI using the command: %s", style.Commandf("upgrade", false)),
},
ErrConnectedOrgDenied: {
Code: ErrConnectedOrgDenied,
Message: "The admin does not allow connected organizations to be named_entities",
},
ErrCommentRequired: {
Code: ErrCommentRequired,
Message: "Your admin is requesting a reason to approve installation of this app",
},
ErrConnectedTeamDenied: {
Code: ErrConnectedTeamDenied,
Message: "The admin does not allow connected teams to be named_entities",
},
ErrContextValueNotFound: {
Code: ErrContextValueNotFound,
Message: "The context value could not be found",
},
ErrCredentialsNotFound: {
Code: ErrCredentialsNotFound,
Message: "No authentication found for this team",
Remediation: fmt.Sprintf("Use the command %s to login to this workspace", style.Commandf("login", false)),
},
ErrCustomizableInputMissingMatchingWorkflowInput: {
Code: ErrCustomizableInputMissingMatchingWorkflowInput,
Message: "Customizable input on the trigger must map to a workflow input of the same name",
},
ErrCustomizableInputsNotAllowedOnOptionalInputs: {
Code: ErrCustomizableInputsNotAllowedOnOptionalInputs,
Message: "Customizable trigger inputs must map to required workflow inputs",
},
ErrCustomizableInputsOnlyAllowedOnLinkTriggers: {
Code: ErrCustomizableInputsOnlyAllowedOnLinkTriggers,
Message: "Customizable inputs are only allowed on link triggers",
},
ErrCustomizableInputUnsupportedType: {
Code: ErrCustomizableInputUnsupportedType,
Message: "Customizable input has been mapped to a workflow input of an unsupported type. Only `UserID`, `ChannelId`, and `String` are supported for customizable inputs",
},
ErrDatastore: {
Code: ErrDatastore,
Message: "An error occurred while accessing your datastore",
},
ErrDatastoreMissingPrimaryKey: {
Code: ErrDatastoreMissingPrimaryKey,
Message: "The primary key for the datastore is missing",
},
ErrDatastoreNotFound: {
Code: ErrDatastoreNotFound,
Message: "The specified datastore could not be found",
},
ErrDefaultAppAccess: {
Code: ErrDefaultAppAccess,
Message: "Couldn't access the default app",
},
ErrDefaultAppSetting: {
Code: ErrDefaultAppSetting,
Message: "Couldn't set this app as the default",
},
ErrDenoNotFound: {
Code: ErrDenoNotFound,
Message: "Couldn't find the 'deno' language runtime installed on this system",
Remediation: "To install Deno, visit https://deno.land/#installation.",
},
ErrDeployedAppNotSupported: {
Code: ErrDeployedAppNotSupported,
Message: "A deployed app cannot be used by this command",
},
ErrDocumentationGenerationFailed: {
Code: ErrDocumentationGenerationFailed,
Message: "Failed to generate documentation",
},
ErrEnterpriseNotFound: {
Code: ErrEnterpriseNotFound,
Message: "The `enterprise` was not found",
},
ErrFailedAddingCollaborator: {
Code: ErrFailedAddingCollaborator,
Message: "Failed writing a collaborator record for this new app",
},
ErrFailedCreatingApp: {
Code: ErrFailedCreatingApp,
Message: "Failed to create the app model",
},
ErrFailedDatastoreOperation: {
Code: ErrFailedDatastoreOperation,
Message: "Failed while managing datastore infrastructure",
Remediation: "Please try again and reach out to feedback@slack.com if the problem persists.",
},
ErrFailedExport: {
Code: ErrFailedExport,
Message: "Couldn't export the app manifest",
},
ErrFailForSomeRequests: {
Code: ErrFailForSomeRequests,
Message: "At least one request was not cancelled",
},
ErrFailedToGetUser: {
Code: ErrFailedToGetUser,
Message: "Couldn't find the user to install the app",
},
ErrFailedToSaveExtensionLogs: {
Code: ErrFailedToSaveExtensionLogs,
Message: "Couldn't save the logs",
},
ErrFailToGetTeamsForRestrictedUser: {
Code: ErrFailToGetTeamsForRestrictedUser,
Message: "Failed to get teams for restricted user",
},
ErrFeedbackNameInvalid: {
Code: ErrFeedbackNameInvalid,
Message: "The name of the feedback is invalid",
Remediation: fmt.Sprintf("View the feedback options with %s", style.Commandf("feedback --help", false)),
},
ErrFeedbackNameRequired: {
Code: ErrFeedbackNameRequired,
Message: "The name of the feedback is required",
Remediation: strings.Join([]string{
"Please provide a `--name <string>` flag or remove the `--no-prompt` flag",
fmt.Sprintf("View feedback options with %s", style.Commandf("feedback --help", false)),
}, "\n"),
},
ErrFileRejected: {
Code: ErrFileRejected,
Message: "Not an acceptable S3 file",
},
ErrForbiddenTeam: {
Code: ErrForbiddenTeam,
Message: "The authenticated team cannot use this API",
},
ErrFreeTeamNotAllowed: {
Code: ErrFreeTeamNotAllowed,
Message: "Free workspaces do not support the Slack platform's low-code automation for workflows and functions",
Remediation: "You can install this app if you upgrade your workspace: https://slack.com/pricing.",
},
ErrFunctionBelongsToAnotherApp: {
Code: ErrFunctionBelongsToAnotherApp,
Message: "The provided function_id does not belong to this app_id",
},
ErrFunctionNotFound: {
Code: ErrFunctionNotFound,
Message: "The specified function couldn't be found",
},
ErrGitNotFound: {
Code: ErrGitNotFound,
Message: "Couldn't find Git installed on this system",
Remediation: "To install Git, visit https://github.com/git-guides/install-git.",
},
ErrGitClone: {
Code: ErrGitClone,
Message: "Git failed to clone repository",
},
ErrGitZipDownload: {
Code: ErrGitZipDownload,
Message: "Cannot download Git repository as a .zip archive",
},
ErrHomeDirectoryAccessFailed: {
Code: ErrHomeDirectoryAccessFailed,
Message: "Failed to read/create .slack/ directory in your home directory",
Remediation: "A Slack directory is required for retrieving/storing auth credentials and config data. Check permissions on your system.",
},
ErrHooksJSONLocation: {
Code: ErrHooksJSONLocation,
Message: "Missing the Slack hooks file from project configurations",
Remediation: fmt.Sprintf("A `%s` file must be present in the project's `.slack` directory.", filepath.Join(".slack", "hooks.json")),
},
ErrHostAppsDisallowUserScopes: {
Code: ErrHostAppsDisallowUserScopes,
Message: "Hosted apps do not support user scopes",
},
ErrHTTPRequestFailed: {
Code: ErrHTTPRequestFailed,
Message: "HTTP request failed",
},
ErrHTTPResponseInvalid: {
Code: ErrHTTPResponseInvalid,
Message: "Received an invalid response from the server",
},
ErrInsecureRequest: {
Code: ErrInsecureRequest,
Message: "The method was not called via a `POST` request",
},
ErrInstallationDenied: {
Code: ErrInstallationDenied,
Message: "Couldn't install the app because the installation request was denied",
Remediation: "Reach out to one of your App Managers for additional information.",
},
ErrInstallationFailed: {
Code: ErrInstallationFailed,
Message: "Couldn't install the app",
},
ErrInstallationRequired: {
Code: ErrInstallationRequired,
Message: "A valid installation of this app is required to take this action",
Remediation: fmt.Sprintf("Install the app with %s", style.Commandf("install", false)),
},
ErrInternal: {
Code: ErrInternal,
Message: "An internal error has occurred with the Slack platform",
Remediation: "Please reach out to feedback@slack.com if the problem persists.",
},
ErrInvalidApp: {
Code: ErrInvalidApp,
Message: "Either the app does not exist or an app created from the provided manifest would not be valid",
},
ErrInvalidAppDirectory: {
Code: ErrInvalidAppDirectory,
Message: "This is an invalid Slack app project directory",
Remediation: strings.Join([]string{
fmt.Sprintf("A valid Slack project includes the Slack hooks file: %s", filepath.Join(".slack", "hooks.json")),
"",
"If this is a Slack project, you can initialize it with " + style.Commandf("init", false),
}, "\n"),
},
ErrInvalidAppFlag: {
Code: ErrInvalidAppFlag,
Message: "The provided --app flag value is not valid",
Remediation: "Specify the environment with `--app local` or `--app deployed`\nOr choose a specific app with `--app <app_id>`",
},
ErrInvalidAppID: {
Code: ErrInvalidAppID,
Message: "App ID may be invalid for this user account and workspace",
Remediation: "Check to make sure you are signed into the correct workspace for this app and you have the required permissions to perform this action.",
},
ErrInvalidArgs: {
Code: ErrInvalidArgs,
Message: "Required arguments either were not provided or contain invalid values",
},
ErrInvalidArgumentsCustomizableInputs: {
Code: ErrInvalidArgumentsCustomizableInputs,
Message: "A trigger input parameter with customizable: true cannot be set as hidden or locked, nor have a value provided at trigger creation time",
},
ErrInvalidArguments: {
Code: ErrInvalidArguments,
Message: "Slack API request parameters are invalid",
},
ErrInvalidAuth: {
Code: ErrInvalidAuth,
Message: "Your user account authorization isn't valid",
Remediation: fmt.Sprintf(
"Your user account authorization may be expired or does not have permission to access the resource. Try to login to the same user account again using %s.",
style.Commandf("login", false),
),
},
ErrInvalidChallenge: {
Code: ErrInvalidChallenge,
Message: "The challenge code is invalid",
Remediation: fmt.Sprintf("The previous slash command and challenge code have now expired. To retry, use %s, paste the slash command in any Slack channel, and enter the challenge code displayed by Slack. It is easiest to copy & paste the challenge code.", style.Commandf("login", false)),
},
ErrInvalidChannelID: {
Code: ErrInvalidChannelID,
Message: "Channel ID specified doesn't exist or you do not have permissions to access it",
Remediation: "Channel ID appears to be formatted correctly. Check if this channel exists on the current team and that you have permissions to access it.",
},
ErrInvalidCursor: {
Code: ErrInvalidCursor,
Message: "Value passed for `cursor` was not valid or is valid no longer",
},
ErrInvalidFlag: {
Code: ErrInvalidFlag,
Message: "The provided flag value is invalid",
},
ErrInvalidDistributionType: {
Code: ErrInvalidDistributionType,
Message: "This function requires distribution_type to be set as named_entities before adding users",
},
ErrInvalidInteractiveTriggerInputs: {
Code: ErrInvalidInteractiveTriggerInputs,
Message: "One or more input parameter types isn't supported by the link trigger type",
},
ErrInvalidManifest: {
Code: ErrInvalidManifest,
Message: "The provided manifest file does not validate against schema. Consult the additional errors field to locate specific issues",
},
ErrInvalidManifestSource: {
Code: ErrInvalidManifestSource,
Message: "A manifest does not exist at the provided source",
Remediation: strings.Join([]string{
fmt.Sprintf("Set 'manifest.source' to either \"remote\" or \"local\" in %s", filepath.Join(".slack", "config.json")),
fmt.Sprintf("Read about manifest sourcing with the %s command", style.Commandf("manifest info --help", false)),
}, "\n"),
},
ErrInvalidParameters: {
Code: ErrInvalidParameters,
Message: "slack_cli_version supplied is invalid",
},
ErrInvalidPermissionType: {
Code: ErrInvalidPermissionType,
Message: "Permission type must be set to `named_entities` before you can manage users",
},
ErrInvalidRefreshToken: {
Code: ErrInvalidRefreshToken,
Message: "The given refresh token is invalid",
},
ErrInvalidRequestID: {
Code: ErrInvalidRequestID,
Message: "The request_id passed is invalid",
},
ErrInvalidResourceID: {
Code: ErrInvalidResourceID,
Message: "The resource_id for the given resource_type is invalid",
},
ErrInvalidResourceType: {
Code: ErrInvalidResourceType,
Message: "The resource_type argument is invalid.",
},
ErrInvalidS3Key: {
Code: ErrInvalidS3Key,
Message: "An internal error occurred",
Remediation: "Please reach out to feedback@slack.com if the problem persists.",
},
ErrInvalidScopes: {
Code: ErrInvalidScopes,
Message: "Some of the provided scopes do not exist",
},
ErrInvalidSemVer: {
Code: ErrInvalidSemVer,
Message: "The provided version does not follow semantic versioning",
},
ErrInvalidSlackProjectDirectory: {
Code: ErrInvalidSlackProjectDirectory,
Message: "Current directory is not a Slack project",
Remediation: fmt.Sprintf("Change in to a Slack project directory. A Slack project always includes the Slack hooks file (`%s`).", filepath.Join(".slack", "hooks.json")),
},
ErrInvalidDatastore: {
Code: ErrInvalidDatastore,
Message: "Invalid datastore specified in your project",
},
ErrInvalidDatastoreExpression: {
Code: ErrInvalidDatastoreExpression,
Message: "The provided expression is not valid",
Remediation: strings.Join([]string{
"Verify the expression you provided is valid JSON surrounded by quotations",
fmt.Sprintf("Use %s for examples", style.Commandf("datastore --help", false)),