MSTableOperationError Class Reference

Inherits from NSObject
Declared in MSTableOperationError.h

Overview

The MSTableOperationError class represents an error that occurred while sending a a table operation (insert, etc) to the Windows Azure Mobile Service during a sync event (for example a Push) The most common causes of a table operation error are non success codes from the server such as a precondition failed response.

Properties

  guid

Unique error id in table store

@property (nonatomic, readonly, nonnull) NSString *guid

Discussion

Unique error id in table store

Declared In

MSTableOperationError.h

  table

The name of the table the operation was being performed for

@property (nonatomic, readonly, copy, nonnull) NSString *table

Discussion

The name of the table the operation was being performed for

Declared In

MSTableOperationError.h

  operation

The type of operation being performed on the table (insert, update, delete)

@property (nonatomic, readonly) MSTableOperationTypes operation

Discussion

The type of operation being performed on the table (insert, update, delete)

Declared In

MSTableOperationError.h

  itemId

The id of the item to the operation ran for

@property (nonatomic, readonly, copy, nonnull) NSString *itemId

Discussion

The id of the item to the operation ran for

Declared In

MSTableOperationError.h

  item

The full item being sent to the server, this item may not always be present for all operations

@property (nonatomic, readonly, copy, nullable) NSDictionary *item

Discussion

The full item being sent to the server, this item may not always be present for all operations

Declared In

MSTableOperationError.h

  code

Represents the error code recieved while executing the table operation, see MSError for a list of Mobile Service’s error codes

@property (nonatomic, readonly) NSInteger code

Discussion

Represents the error code recieved while executing the table operation, see MSError for a list of Mobile Service’s error codes

Declared In

MSTableOperationError.h

  domain

Represents the domain of the error recieved while executing the table operation, this will typically be the MSErrorDomain, but may differ if the delegate chooses to return other error types

@property (nonatomic, readonly, nullable) NSString *domain

Discussion

Represents the domain of the error recieved while executing the table operation, this will typically be the MSErrorDomain, but may differ if the delegate chooses to return other error types

Declared In

MSTableOperationError.h

  description

A description of what caused the operation to fail

@property (nonatomic, readonly, nonnull) NSString *description

Discussion

A description of what caused the operation to fail

Declared In

MSTableOperationError.h

  statusCode

The HTTP status code recieved while executing the operation from the mobile service. Note: this item may not be set if the operation failed before going to the server

@property (nonatomic, readonly) NSInteger statusCode

Discussion

The HTTP status code recieved while executing the operation from the mobile service. Note: this item may not be set if the operation failed before going to the server

Declared In

MSTableOperationError.h

  serverItem

When the status code is a precondition failure, this item will contain the current version of the item on the server

@property (nonatomic, readonly, nullable) NSDictionary *serverItem

Discussion

When the status code is a precondition failure, this item will contain the current version of the item on the server

Declared In

MSTableOperationError.h

Handling Errors

  handled

Set the handled flag to indicate that all appropriate actions for this error have been taken and the error will be removed from the list

@property (nonatomic) BOOL handled

Discussion

Set the handled flag to indicate that all appropriate actions for this error have been taken and the error will be removed from the list

Declared In

MSTableOperationError.h

– cancelOperationAndUpdateItem:completion:

Removes the pending operation so it will not be tried again the next time push is called. In addition, updates the local store state

- (void)cancelOperationAndUpdateItem:(nonnull NSDictionary *)item completion:(nullable MSSyncBlock)completion

Discussion

Removes the pending operation so it will not be tried again the next time push is called. In addition, updates the local store state

Declared In

MSTableOperationError.h

– cancelOperationAndDiscardItemWithCompletion:

Removes the pending operation so it will not be tried again the next time push is called. In addition, removes the item associated with the operation from the local store

- (void)cancelOperationAndDiscardItemWithCompletion:(nullable MSSyncBlock)completion

Discussion

Removes the pending operation so it will not be tried again the next time push is called. In addition, removes the item associated with the operation from the local store

Declared In

MSTableOperationError.h

Initializing the MSTableOperationError Object

– initWithOperation:item:context:error:

Initializes the table operation error from the provided operation, item, error, and context objects.

- (nonnull instancetype)initWithOperation:(nonnull MSTableOperation *)operation item:(nonnull NSDictionary *)item context:(nullable MSSyncContext *)context error:(nonnull NSError *)error

Discussion

Initializes the table operation error from the provided operation, item, error, and context objects.

Declared In

MSTableOperationError.h

– initWithOperation:item:error:

- (nonnull instancetype)initWithOperation:(nonnull MSTableOperation *)operation item:(nonnull NSDictionary *)item error:(nonnull NSError *)error

– initWithSerializedItem:context:

Initializes the table operation error from a serialized representation of a MSTableOperationError.

- (nonnull instancetype)initWithSerializedItem:(nonnull NSDictionary *)item context:(nullable MSSyncContext *)context

Discussion

Initializes the table operation error from a serialized representation of a MSTableOperationError.

Declared In

MSTableOperationError.h

– initWithSerializedItem:

- (nonnull instancetype)initWithSerializedItem:(nonnull NSDictionary *)item

Serializing the MSTableOperationError Object

– serialize

Returns an NSDictionary with two keys, id and properties, where properties contains a serialized version of the error

- (nonnull NSDictionary *)serialize

Discussion

Returns an NSDictionary with two keys, id and properties, where properties contains a serialized version of the error

Declared In

MSTableOperationError.h