Skip to content

Commit 0f8c092

Browse files
mwbrookszimeg
andauthored
fix: update broken URL in the hooks.json error message (#3)
* fix: update hooks.json error to include a working example * fix: tweak wording of Slack hooks file title * Update internal/slackerror/errors.go Co-authored-by: Eden Zimbelman <[email protected]> * Update internal/slackerror/errors.go Co-authored-by: Eden Zimbelman <[email protected]> --------- Co-authored-by: Eden Zimbelman <[email protected]>
1 parent bb9a1f7 commit 0f8c092

File tree

1 file changed

+15
-7
lines changed

1 file changed

+15
-7
lines changed

internal/slackerror/errors.go

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -806,9 +806,13 @@ Otherwise start your app for local development with: %s`,
806806
},
807807

808808
ErrInvalidAppDirectory: {
809-
Code: ErrInvalidAppDirectory,
810-
Message: "This is an invalid Slack app project directory",
811-
Remediation: fmt.Sprintf("A valid Slack project includes the Slack hooks file: %s", filepath.Join(".slack", "hooks.json")),
809+
Code: ErrInvalidAppDirectory,
810+
Message: "This is an invalid Slack app project directory",
811+
Remediation: strings.Join([]string{
812+
fmt.Sprintf("A valid Slack project includes the Slack hooks file: %s", filepath.Join(".slack", "hooks.json")),
813+
"",
814+
"If this is a Slack project, you can initialize it with " + style.Commandf("init", false),
815+
}, "\n"),
812816
},
813817

814818
ErrInvalidAppFlag: {
@@ -1292,12 +1296,16 @@ Otherwise start your app for local development with: %s`,
12921296
Code: ErrSDKHookNotFound,
12931297
Message: fmt.Sprintf("A script in %s was not found", style.Highlight(filepath.Join(".slack", "hooks.json"))),
12941298
Remediation: strings.Join([]string{
1295-
fmt.Sprintf("Hook scripts are defined in the Slack hooks file ('%s').", filepath.Join(".slack", "hooks.json")),
1296-
"Every app requires a Slack hooks file and you can find a working example at:",
1299+
"Hook scripts are defined in one of these Slack hooks files:",
1300+
"- slack.json",
1301+
"- " + filepath.Join(".slack", "hooks.json"),
1302+
"",
1303+
"Every app requires a Slack hooks file and you can find an example at:",
1304+
style.Highlight("https://github.com/slack-samples/deno-starter-template/blob/main/slack.json"),
12971305
"",
1298-
style.Highlight("https://github.com/slack-samples/deno-starter-template/blob/main/.slack/hooks.json"),
1306+
"You can create a hooks file manually or with the " + style.Commandf("init", false) + " command.",
12991307
"",
1300-
"After creating the hooks file, you must install related hook dependencies.",
1308+
"When manually creating the hooks file, you must install the hook dependencies.",
13011309
}, "\n"),
13021310
},
13031311

0 commit comments

Comments
 (0)