LuciadCPillar 2023.1.04
luciad::FeatureSaveErrorInfo Class Referencefinal

This class contains details on a failed IFeatureModel save. More...

#include <luciad/models/features/FeatureSaveErrorInfo.h>

Classes

class  Builder
 Builder that allows FeatureSaveErrorInfo instances to be created. More...
 

Public Member Functions

ErrorInfo getFeatureError (FeatureId featureId) const
 Retrieves the ErrorInfo associated with a specific feature. More...
 
std::vector< FeatureIdgetFeatureIds () const
 If the save action fails because one or more features can't be added, updated or removed, this method returns a non-empty list containing the id's of the features involved in the save action failure. More...
 
std::optional< ErrorInfogetGeneralError () const
 If the save action failed because of an error not related to specific features, this method returns information on that error. More...
 

Static Public Member Functions

static Builder newBuilder ()
 Returns a new FeatureSaveErrorInfo builder. More...
 

Detailed Description

This class contains details on a failed IFeatureModel save.

It can contain a general error or one or more feature-specific errors, or both, but never neither.

A general error can, for example, be a database connection failure or the lack of permissions to write to a file.

A feature error can, for example, be a violation of a constraint enforced by the backend on features.

Since
2023.1

Member Function Documentation

◆ getFeatureError()

ErrorInfo luciad::FeatureSaveErrorInfo::getFeatureError ( FeatureId  featureId) const

Retrieves the ErrorInfo associated with a specific feature.

Returns
the ErrorInfo associated with a specific feature.
Exceptions
luciad::InvalidArgumentExceptionwhen a featureId with no associated ErrorInfo is used (that is, not in the list obtained from getFeatureIds).

◆ getFeatureIds()

std::vector< FeatureId > luciad::FeatureSaveErrorInfo::getFeatureIds ( ) const

If the save action fails because one or more features can't be added, updated or removed, this method returns a non-empty list containing the id's of the features involved in the save action failure.

Note that an IFeatureModel may abort after the first failure, with other failing feature changes possible being present.

Returns
all FeatureId's of the features that were involved in the save action failure. An empty list if the error was not related to a specific feature.

◆ getGeneralError()

std::optional< ErrorInfo > luciad::FeatureSaveErrorInfo::getGeneralError ( ) const

If the save action failed because of an error not related to specific features, this method returns information on that error.

Returns
the cause of the failed save action, if related to a feature.

◆ newBuilder()

static Builder luciad::FeatureSaveErrorInfo::newBuilder ( )
static

Returns a new FeatureSaveErrorInfo builder.

Returns
a new FeatureSaveErrorInfo builder.