]> Entropealabs - wampex.git/commitdiff
add publish_error
authorChristopher <chris@entropealabs.com>
Thu, 2 Apr 2020 00:16:42 +0000 (19:16 -0500)
committerChristopher <chris@entropealabs.com>
Thu, 2 Apr 2020 00:16:42 +0000 (19:16 -0500)
lib/roles/broker.ex

index 7c1b0b69b4968bbd4140093c964f5bf2d1f427ed..b97d12d66baaf6a9e53155534f5293301b3d9cd9 100644 (file)
@@ -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,