From 61d834a784f5f14ec90508cf7556a5ebaec113c3 Mon Sep 17 00:00:00 2001 From: Christopher Date: Wed, 1 Apr 2020 19:16:42 -0500 Subject: [PATCH] add publish_error --- lib/roles/broker.ex | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/roles/broker.ex b/lib/roles/broker.ex index 7c1b0b6..b97d12d 100644 --- a/lib/roles/broker.ex +++ b/lib/roles/broker.ex @@ -99,6 +99,11 @@ defmodule Wampex.Roles.Broker do [@published, ri, pi] end + @spec publish_error(Error.t()) :: Wampex.message() + def publish_error(%Error{request_id: ri, error: error, details: dets}) do + [@error, @publish, ri, dets, error] + end + @impl true def handle([@subscribe, request_id, opts, topic]) do {[{:next_event, :internal, :subscribe}], request_id, -- 2.45.3