forked from fsprojects/FSharp.Data.GraphQL
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathExceptions.fs
More file actions
42 lines (33 loc) · 1.3 KB
/
Copy pathExceptions.fs
File metadata and controls
42 lines (33 loc) · 1.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
// The MIT License (MIT)
// Copyright (c) 2016 Bazinga Technologies Inc
namespace FSharp.Data.GraphQL
open System
open System.Collections.Immutable
open System.Collections.Generic
open System.Runtime.InteropServices
[<AbstractClass>]
type GraphQLException =
inherit Exception
new () = { inherit Exception () }
new (msg) = { inherit Exception (msg) }
[<AbstractClass>]
type GQLMessageExceptionBase (errorKind, msg, [<Optional>] extensions : _ | null) =
inherit GraphQLException (msg)
interface IGQLError with
member _.Message = msg
interface IGQLExceptionError with
member this.Exception = this
interface IGQLErrorExtensions with
member _.Extensions =
match extensions with
| null -> Dictionary<string, obj> 1
| _ -> extensions
|> GQLProblemDetails.SetErrorKind errorKind
|> ValueSome
type GQLMessageException (msg, [<Optional>] extensions) =
inherit GQLMessageExceptionBase (Execution, msg, extensions)
type InvalidInputTypeException (msg, unmatchedOptionalFields) =
inherit GQLMessageExceptionBase (InputCoercion, msg)
member _.UnmatchedOptionalFields : string ImmutableHashSet = unmatchedOptionalFields
type MalformedGQLQueryException (msg) =
inherit GQLMessageExceptionBase (Validation, msg)