File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import '@testing-library/jest-dom' ;
2+ import { TextEncoder , TextDecoder } from 'util' ;
3+
4+ global . TextEncoder = TextEncoder ;
5+ global . TextDecoder = TextDecoder as typeof global . TextDecoder ;
26
37if ( ! process . env . NEXT_PUBLIC_SUPABASE_URL ) {
48 process . env . NEXT_PUBLIC_SUPABASE_URL = 'http://localhost:8000' ;
Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ export class AnnotationService {
2828
2929 if ( error ) {
3030 console . error ( 'Error fetching annotations:' , error ) ;
31- throw error ;
31+ throw new Error ( error . message || 'Database error' ) ;
3232 }
3333
3434 return ( data || [ ] ) as AnnotationWithUser [ ] ;
@@ -63,7 +63,7 @@ export class AnnotationService {
6363
6464 if ( error ) {
6565 console . error ( 'Error creating highlight:' , error ) ;
66- throw error ;
66+ throw new Error ( error . message || 'Database error' ) ;
6767 }
6868
6969 return annotationData ;
@@ -98,7 +98,7 @@ export class AnnotationService {
9898
9999 if ( error ) {
100100 console . error ( 'Error creating comment:' , error ) ;
101- throw error ;
101+ throw new Error ( error . message || 'Database error' ) ;
102102 }
103103
104104 return annotationData ;
@@ -123,7 +123,7 @@ export class AnnotationService {
123123
124124 if ( error ) {
125125 console . error ( 'Error deleting annotation:' , error ) ;
126- throw error ;
126+ throw new Error ( error . message || 'Database error' ) ;
127127 }
128128 } catch ( error ) {
129129 console . error ( 'Error in deleteAnnotation:' , error ) ;
You can’t perform that action at this time.
0 commit comments