mirror of
https://github.com/avinal/avinal.github.io.git
synced 2026-07-04 07:40:09 +05:30
add new elm-land website
Signed-off-by: Avinal Kumar <avinal.xlvii@gmail.com>
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
module Utils.Utils exposing (..)
|
||||
|
||||
import Http exposing (Error(..))
|
||||
import Utils.Constants exposing (..)
|
||||
|
||||
|
||||
contentUrl : { category : String, post : String } -> String
|
||||
contentUrl { category, post } =
|
||||
contentUrlPrefix ++ "posts/" ++ category ++ "/" ++ post ++ ".md"
|
||||
|
||||
|
||||
errorToString : Http.Error -> String
|
||||
errorToString error =
|
||||
case error of
|
||||
BadUrl url ->
|
||||
"The URL " ++ url ++ " was invalid"
|
||||
|
||||
Timeout ->
|
||||
"Unable to reach the server, try again"
|
||||
|
||||
NetworkError ->
|
||||
"Unable to reach the server, check your network connection"
|
||||
|
||||
BadStatus 500 ->
|
||||
"The server had a problem, try again later"
|
||||
|
||||
BadStatus 400 ->
|
||||
"Verify your information and try again"
|
||||
|
||||
BadStatus _ ->
|
||||
"Unknown error"
|
||||
|
||||
BadBody errorMessage ->
|
||||
errorMessage
|
||||
Reference in New Issue
Block a user