Skip to main content
Browse Documentation


Created by Scott Yearsley, last modified by noellambertwork on 15 Dec 2017

Things go wrong, either because the client is asking for something that does not exist, a network failure occurred or a bug is in the code. All non-success HTTP responses are treated as errors and are wrapped up in the client API to allow them to be handled.

Handling errors

Errors returned as HTTP errors are subsequently wrapped in appropriate Exception types - ValidationException and RestRequestException. Local errors that occur in the client API are thrown as standard .NET exceptions, such as ArgumentException or IndexOutOfBoundsException.


Handling .NET exceptions:

using Zengenti.Contensis.Management;
using Zengenti.Rest;
using Zengenti.Validation;

public class Program
    static void Main()
            var client = ManagementClient.Create(

            var movieDbProject = client.Projects.Get("movieDb");

            // Get a specific entry
            var entry = movieDbProject.Entries.Get("9c64e11e-fcf0-44a6-adff-41e13de15515");

            // Update a value
            entry.Set("yearOfRelease", 1978);

            // Commit the change
        catch(ValidationException valEx)
            // Validation error(s)
        catch(RestRequestException valEx)
            // Something went wrong, likely on the server
        catch(Exception ex)
            // Something went wrong in the client API