Added inventaire import from ISBN
This commit is contained in:
@@ -16,6 +16,14 @@ type InventaireEditionDetailedSingleResult struct {
|
||||
Lang string
|
||||
}
|
||||
|
||||
type ErrorEditionNotFound struct {
|
||||
InventaireId string
|
||||
}
|
||||
|
||||
func (e *ErrorEditionNotFound) Error() string {
|
||||
return fmt.Sprintf("No edition found on inventaire for id %s\n", e.InventaireId)
|
||||
}
|
||||
|
||||
func CallInventaireEdition(inventaireId string, lang string) (InventaireEditionDetailedSingleResult, error) {
|
||||
var result InventaireEditionDetailedSingleResult
|
||||
editionQueryResults, err := callInventaireEditionEntities([]string{inventaireId})
|
||||
@@ -24,7 +32,7 @@ func CallInventaireEdition(inventaireId string, lang string) (InventaireEditionD
|
||||
}
|
||||
var editionQueryResult inventaireEditionQueryEntity
|
||||
if len(editionQueryResults.Entities) < 1 {
|
||||
return result, fmt.Errorf("No edition found on inventaire for id %s", inventaireId)
|
||||
return result, &ErrorEditionNotFound{InventaireId: inventaireId}
|
||||
}
|
||||
|
||||
editionQueryResult = editionQueryResults.Entities[0]
|
||||
|
||||
Reference in New Issue
Block a user