@@ -85,12 +85,6 @@ impl<'store> Translatable<'store> for ResultItem<'store, Annotation> {
8585 mut config : TranslateConfig ,
8686 ) -> Result < Vec < AnnotationBuilder < ' static > > , StamError > {
8787 if let Some ( tset) = self . textselectionset ( ) {
88- if tset. inner ( ) . is_empty ( ) {
89- return Err ( StamError :: TranslateError (
90- "Can not translate an annotation that references no text or text in multiple resources" . to_string ( ) ,
91- "(translate annotation)" ,
92- ) ) ;
93- }
9488 if config. source_side_id . is_none ( ) && self . id ( ) . is_some ( ) {
9589 config. source_side_id = Some (
9690 self . id ( )
@@ -117,9 +111,8 @@ impl<'store> Translatable<'store> for ResultItem<'store, Annotation> {
117111 } )
118112 . collect ( ) )
119113 } else {
120- Err ( StamError :: TranslateError (
121- "Can not translate an annotation that references no text or text in multiple resources" . to_string ( ) ,
122- "(translate annotation)" ,
114+ Err ( StamError :: NoText (
115+ "Can not translate an annotation that references no text or text in multiple resources" ,
123116 ) )
124117 }
125118 }
@@ -133,9 +126,8 @@ impl<'store> Translatable<'store> for ResultTextSelectionSet<'store> {
133126 ) -> Result < Vec < AnnotationBuilder < ' static > > , StamError > {
134127 via. valid_translation ( ) ?;
135128 if self . inner ( ) . is_empty ( ) {
136- return Err ( StamError :: TranslateError (
137- format ! ( "Can not translate empty TextSelectionSet" ) ,
138- "" ,
129+ return Err ( StamError :: NoText (
130+ "Can not translate empty TextSelectionSet" ,
139131 ) ) ;
140132 }
141133
0 commit comments