This repository was archived by the owner on Oct 31, 2024. It is now read-only.
File tree 2 files changed +12
-3
lines changed
2 files changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -17,4 +17,6 @@ archive/
17
17
node_modules
18
18
19
19
# https://github.com/avajs/ava/blob/main/docs/recipes/code-coverage.md
20
- coverage
20
+ coverage
21
+
22
+ tmp
Original file line number Diff line number Diff line change @@ -599,6 +599,8 @@ export class Collection<TSchema = Document> {
599
599
} = this . connection ;
600
600
601
601
const headers = new Headers ( h ) ;
602
+ headers . set ( "content-type" , "application/ejson" ) ;
603
+
602
604
if ( requestOptions . operationName ) {
603
605
headers . set ( "x-realm-op-name" , requestOptions . operationName ) ;
604
606
}
@@ -621,9 +623,14 @@ export class Collection<TSchema = Document> {
621
623
if ( response . status < 200 || response . status >= 400 ) {
622
624
let errorText : string | undefined ;
623
625
try {
624
- errorText = ( ( await response . json ( ) ) as { error : string } ) ?. error ;
626
+ errorText = ( ( await response . clone ( ) . json ( ) ) as { error : string } )
627
+ ?. error ;
625
628
} catch {
626
- /* c8 ignore next */
629
+ try {
630
+ errorText = await response . clone ( ) . text ( ) ;
631
+ } catch {
632
+ errorText = undefined ;
633
+ }
627
634
}
628
635
629
636
const fallbackMessage = {
You can’t perform that action at this time.
0 commit comments