Table of Contents

Class JobError

Namespace
Google.GenAI.Types
Assembly
Google.GenAI.dll

Job error.

public record JobError : IEquatable<JobError>
Inheritance
JobError
Implements
Inherited Members

Properties

Code

The status code.

[JsonPropertyName("code")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public int? Code { get; set; }

Property Value

int?

Details

A list of messages that carry the error details. There is a common set of message types for APIs to use.

[JsonPropertyName("details")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public List<string>? Details { get; set; }

Property Value

List<string>

Message

A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the details field.

[JsonPropertyName("message")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? Message { get; set; }

Property Value

string

Methods

FromJson(string, JsonSerializerOptions?)

Deserializes a JSON string to a JobError object.

public static JobError? FromJson(string jsonString, JsonSerializerOptions? options = null)

Parameters

jsonString string

The JSON string to deserialize.

options JsonSerializerOptions

Optional JsonSerializerOptions.

Returns

JobError

The deserialized JobError object, or null if deserialization fails.