[Pkg-ganeti-devel] [ganeti] 68/165: Refactor error404 in metad using OverloadedStrings
Apollon Oikonomopoulos
apoikos at moszumanska.debian.org
Tue Aug 11 13:53:14 UTC 2015
This is an automated email from the git hooks/post-receive script.
apoikos pushed a commit to branch master
in repository ganeti.
commit 0014dccf19eff1bf208ef1977251a84aae0b2a8c
Author: Petr Pudlak <pudlak at google.com>
Date: Wed Nov 5 17:06:24 2014 +0100
Refactor error404 in metad using OverloadedStrings
We already use this extension and it will come in handy for future
improvements in the module as well.
Signed-off-by: Petr Pudlak <pudlak at google.com>
Reviewed-by: Klaus Aehlig <aehlig at google.com>
---
src/Ganeti/Metad/WebServer.hs | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/src/Ganeti/Metad/WebServer.hs b/src/Ganeti/Metad/WebServer.hs
index 5fc4b33..8558911 100644
--- a/src/Ganeti/Metad/WebServer.hs
+++ b/src/Ganeti/Metad/WebServer.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE FlexibleContexts #-}
+{-# LANGUAGE FlexibleContexts, OverloadedStrings #-}
{-| Web server for the metadata daemon.
-}
@@ -73,10 +73,11 @@ lookupInstanceParams inst params =
Nothing -> throwError $ "Could not get instance params for " ++ show inst
Just x -> return x
+-- | The 404 "not found" error.
error404 :: MetaM
error404 = do
- modifyResponse . setResponseStatus 404 $ ByteString.pack "Not found"
- writeBS $ ByteString.pack "Resource not found"
+ modifyResponse $ setResponseStatus 404 "Not found"
+ writeBS "Resource not found"
maybeResult :: MonadError String m => Result t -> (t -> m a) -> m a
maybeResult (Error err) _ = throwError err
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ganeti/ganeti.git
More information about the Pkg-ganeti-devel
mailing list