1
0
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:
2023-01-02 12:45:21 +05:30
parent 0097117553
commit 239c67da1c
19 changed files with 2389 additions and 11 deletions
+34
View File
@@ -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