Skip to content

Commit

Permalink
Samples: Fix schema exception handling (#1520)
Browse files Browse the repository at this point in the history
* samples: schema evolution

* samples: schema evolution

* Format fixes

* Fix documentation for field.

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

* Add back in working asserts

* Formatting fixes

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

* Version/delete fixes

* samples: schema evolution

* samples: schema evolution

* Format fixes

* Fix documentation for field.

* Add back in working asserts

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

* Formatting fixes

* Version/delete fixes

* samples: Schema evolution (#1499)

* samples: schema evolution

* samples: schema evolution

* Format fixes

* Fix documentation for field.

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

* Add back in working asserts

* Formatting fixes

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

* Version/delete fixes

* samples: schema evolution

* samples: schema evolution

* Format fixes

* Fix documentation for field.

* Add back in working asserts

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

* Formatting fixes

* Version/delete fixes

---------

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>

* Minor fixes for comments

* samples: Schema evolution (#1499)

* samples: schema evolution

* samples: schema evolution

* Format fixes

* Fix documentation for field.

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

* Add back in working asserts

* Formatting fixes

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

* Version/delete fixes

* samples: schema evolution

* samples: schema evolution

* Format fixes

* Fix documentation for field.

* Add back in working asserts

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

* Formatting fixes

* Version/delete fixes

---------

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>

* Fix rollback example

* Formatting

* Formatting and wording fixes

* Add new schemas to test directory

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

* Samples: Fix exception handling

* fix: Set x-goog-request-params for streaming pull request

* Revert "fix: Set x-goog-request-params for streaming pull request"

This reverts commit 3185a3e.

---------

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
  • Loading branch information
kamalaboulhosn and gcf-owl-bot[bot] authored Mar 14, 2023
1 parent a28803d commit d78b570
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

// [START pubsub_commit_avro_schema]

import com.google.api.gax.rpc.AlreadyExistsException;
import com.google.api.gax.rpc.NotFoundException;
import com.google.cloud.pubsub.v1.SchemaServiceClient;
import com.google.pubsub.v1.ProjectName;
import com.google.pubsub.v1.Schema;
Expand Down Expand Up @@ -60,8 +60,8 @@ public static Schema commitAvroSchemaExample(String projectId, String schemaId,

System.out.println("Committed a schema using an Avro schema:\n" + schema);
return schema;
} catch (AlreadyExistsException e) {
System.out.println(schemaName + "already exists.");
} catch (NotFoundException e) {
System.out.println(schemaName + "does not exist.");
return null;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

// [START pubsub_commit_proto_schema]

import com.google.api.gax.rpc.AlreadyExistsException;
import com.google.api.gax.rpc.NotFoundException;
import com.google.cloud.pubsub.v1.SchemaServiceClient;
import com.google.pubsub.v1.ProjectName;
import com.google.pubsub.v1.Schema;
Expand Down Expand Up @@ -60,8 +60,8 @@ public static Schema commitProtoSchemaExample(String projectId, String schemaId,

System.out.println("Committed a schema using a protobuf schema:\n" + schema);
return schema;
} catch (AlreadyExistsException e) {
System.out.println(schemaName + "already exists.");
} catch (NotFoundException e) {
System.out.println(schemaName + "does not exist.");
return null;
}
}
Expand Down

0 comments on commit d78b570

Please sign in to comment.