-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MM-44112 - Upsell flow for cloud (#78)
* pricing flow and modals, notify admins * go mod tidy * merge conflicts * server-side PR comments * edge case for cloud sku * UI PR comments * go mod tidy * go mod tidy * Update server/cloud_limits.go Co-authored-by: Justine Geffen <[email protected]> * Update server/cloud_limits.go Co-authored-by: Justine Geffen <[email protected]> * Update webapp/src/cloud_pricing/modals.tsx Co-authored-by: Justine Geffen <[email protected]> * Update webapp/src/cloud_pricing/modals.tsx Co-authored-by: Justine Geffen <[email protected]> * Update webapp/src/cloud_pricing/modals.tsx Co-authored-by: Justine Geffen <[email protected]> * Update webapp/src/cloud_pricing/modals.tsx Co-authored-by: Justine Geffen <[email protected]> * Update webapp/src/cloud_pricing/modals.tsx Co-authored-by: Justine Geffen <[email protected]> * Update webapp/src/components/channel_header_button/component.tsx Co-authored-by: Justine Geffen <[email protected]> * Update webapp/src/components/channel_header_button/component.tsx Co-authored-by: Justine Geffen <[email protected]> * Update webapp/src/components/channel_header_button/component.tsx Co-authored-by: Justine Geffen <[email protected]> * Update webapp/src/components/channel_header_button/component.tsx Co-authored-by: Justine Geffen <[email protected]> * Update webapp/src/components/channel_header_dropdown_button/component.tsx Co-authored-by: Justine Geffen <[email protected]> * Update webapp/src/components/channel_header_dropdown_button/component.tsx Co-authored-by: Justine Geffen <[email protected]> * Update webapp/src/components/channel_header_dropdown_button/component.tsx Co-authored-by: Justine Geffen <[email protected]> * copy change * copy change Co-authored-by: Justine Geffen <[email protected]>
- Loading branch information
1 parent
0f39e23
commit fb89a5a
Showing
26 changed files
with
1,714 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package main | ||
|
||
import ( | ||
"encoding/json" | ||
"fmt" | ||
"net/http" | ||
) | ||
|
||
func (p *Plugin) handleError(w http.ResponseWriter, internalErr error) { | ||
p.handleErrorWithCode(w, http.StatusInternalServerError, "An internal error has occurred. Check app server logs for details.", internalErr) | ||
} | ||
|
||
// handleErrorWithCode logs the internal error and sends the public facing error | ||
// message as JSON in a response with the provided code. | ||
func (p *Plugin) handleErrorWithCode(w http.ResponseWriter, code int, publicErrorMsg string, internalErr error) { | ||
w.Header().Set("Content-Type", "application/json") | ||
w.WriteHeader(code) | ||
|
||
details := "" | ||
if internalErr != nil { | ||
details = internalErr.Error() | ||
} | ||
|
||
p.LogError(fmt.Sprintf("public error message: %v; internal details: %v", publicErrorMsg, details)) | ||
|
||
responseMsg, _ := json.Marshal(struct { | ||
Error string `json:"error"` // A public facing message providing details about the error. | ||
}{ | ||
Error: publicErrorMsg, | ||
}) | ||
_, _ = w.Write(responseMsg) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.