Skip to content
Snippets Groups Projects
Unverified Commit 634cf9bc authored by Tom Robinson's avatar Tom Robinson
Browse files

Catch and surface pulse channel errors. Resolves #3016

parent 709c7a4c
No related branches found
No related tags found
No related merge requests found
......@@ -160,6 +160,9 @@ export default class PulseEditChannels extends Component {
let isValid = this.props.pulseIsValid && channelIsValid(channel, channelSpec);
return (
<li key={index} className="py2">
{ channelSpec.error &&
<div className="pb2 text-bold text-error">{channelSpec.error}</div>
}
{ channelSpec.recipients &&
<div>
<div className="h4 text-bold mb1">To:</div>
......
......@@ -86,12 +86,14 @@
;; no Slack integration, so we are g2g
chan-types
;; if we have Slack enabled build a dynamic list of channels/users
(let [slack-channels (for [channel (slack/channels-list)]
(str \# (:name channel)))
slack-users (for [user (slack/users-list)]
(str \@ (:name user)))]
(assoc-in chan-types [:slack :fields 0 :options] (concat slack-channels slack-users))))}))
(try
(let [slack-channels (for [channel (slack/channels-list)]
(str \# (:name channel)))
slack-users (for [user (slack/users-list)]
(str \@ (:name user)))]
(assoc-in chan-types [:slack :fields 0 :options] (concat slack-channels slack-users)))
(catch Throwable e
(assoc-in chan-types [:slack :error] (.getMessage e)))))}))
(defendpoint GET "/preview_card/:id"
"Get HTML rendering of a `Card` with ID."
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment