Skip to content

Commit

Permalink
Improved the error messages for Zoom API failures (MM-13814) (#16)
Browse files Browse the repository at this point in the history
  • Loading branch information
levb authored and jwilander committed Jan 31, 2019
1 parent 8a19879 commit ace51b9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion server/zoom/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ func (c *Client) request(method string, path string, data interface{}, ret inter
defer closeBody(rp)
buf := new(bytes.Buffer)
buf.ReadFrom(rp.Body)
return &ClientError{rp.StatusCode, fmt.Sprintf("response_body=%v", c.BaseUrl+path)}
return &ClientError{rp.StatusCode, buf.String()}
} else {
defer closeBody(rp)
buf := new(bytes.Buffer)
Expand Down
9 changes: 8 additions & 1 deletion webapp/src/actions/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,13 @@ export function startMeeting(channelId) {
try {
await Client.startMeeting(channelId, true);
} catch (error) {
let m = 'We could not verify your Mattermost account in Zoom. Please ensure that your Mattermost email address matches your Zoom email address.';
if (error.response && error.response.text) {
const e = JSON.parse(error.response.text);
if (e && e.message) {
m = 'Zoom error: ' + e.message;
}
}
const post = {
id: 'zoomPlugin' + Date.now(),
create_at: Date.now(),
Expand All @@ -22,7 +29,7 @@ export function startMeeting(channelId) {
root_id: '',
parent_id: '',
original_id: '',
message: 'We could not verify your Mattermost account in Zoom. Please ensure that your Mattermost email address matches your Zoom email address.',
message: m,
type: 'system_ephemeral',
props: {},
hashtags: '',
Expand Down

0 comments on commit ace51b9

Please sign in to comment.