File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed
Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -131,6 +131,13 @@ func printID(s string) string {
131131 return s
132132}
133133
134+ func printName (s string ) string {
135+ if s == "" {
136+ return "<blank name>"
137+ }
138+ return s
139+ }
140+
134141// ValidateDispatchRules checks a set of dispatch rules for conflicts.
135142//
136143// Deprecated: use ValidateDispatchRulesIter
@@ -208,8 +215,9 @@ func (v *DispatchRuleValidator) Validate(r *livekit.SIPDispatchRuleInfo) error {
208215 if v .opt .AllowConflicts {
209216 continue
210217 }
211- return twirp .NewErrorf (twirp .InvalidArgument , "Conflicting SIP Dispatch Rules: same Trunk+Number+PIN combination for for %q and %q" ,
212- printID (r .SipDispatchRuleId ), printID (r2 .SipDispatchRuleId ))
218+ return twirp .NewErrorf (twirp .InvalidArgument ,
219+ "Dispatch rule for the same trunk, number, and pin combination already exists in dispatch rule %q %q" ,
220+ printID (r2 .SipDispatchRuleId ), printName (r2 .Name ))
213221 }
214222 v .byRuleKey [key ] = r
215223 }
You can’t perform that action at this time.
0 commit comments