Skip to content
This repository has been archived by the owner on May 27, 2022. It is now read-only.

Commit

Permalink
white list reply routing exceptions
Browse files Browse the repository at this point in the history
  • Loading branch information
erin committed Jul 18, 2013
1 parent ab6e682 commit 8ac5d81
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
15 changes: 12 additions & 3 deletions Network/Riak/Montage/Protocol.hs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import Control.Concurrent (forkIO)
import qualified Data.ByteString.Lazy.Char8 as B
import qualified Data.ByteString.Lazy as BW
import qualified Data.ByteString.Char8 as S
import Control.Exception (try, SomeException)
import Control.Exception (try, SomeException, throw)
import Text.ProtocolBuffers.WireMessage (messageGet, messagePut)
import Text.ProtocolBuffers.Basic (uFromString)
import Data.Aeson (object, (.=))
Expand Down Expand Up @@ -42,8 +42,17 @@ nitroCallback :: NitroSocket
-> S.ByteString
-> IO ()
nitroCallback s fr out = do
frBack <- bstrToFrame out
reply s fr frBack []
res <- try wrapCallback
case res of
Left (e :: SomeException) ->
if show e == moveon then logError moveon else throw e
Right _ -> return ()
where
moveon = "specified frame recipient not found in socket table"

wrapCallback = do
frBack <- bstrToFrame out
reply s fr frBack []

serveMontage :: (MontageRiakValue r) =>
(MontageEnvelope -> ChainCommand r) ->
Expand Down
2 changes: 1 addition & 1 deletion montage.cabal
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Name: montage
Version: 0.3.5
Version: 0.3.6
Synopsis: Riak Resolution Proxy
Homepage: http://github.com/bumptech/montage
License: BSD3
Expand Down

0 comments on commit 8ac5d81

Please sign in to comment.