From 1f5a91077d786f25a29c60a92b1be38c43b69ef8 Mon Sep 17 00:00:00 2001 From: Andrzej Danilowski Date: Tue, 21 Jul 2026 10:54:47 +0200 Subject: [PATCH 1/2] Release 1.12.0 --- .travis.yml | 2 +- Gemfile.lock | 2 +- README.md | 8 +- VERSION | 2 +- docs/ErrorResponseError.md | 2 +- lib/dropbox-sign/api/account_api.rb | 12 +- lib/dropbox-sign/api/api_app_api.rb | 13 +- lib/dropbox-sign/api/bulk_send_job_api.rb | 6 +- lib/dropbox-sign/api/embedded_api.rb | 6 +- lib/dropbox-sign/api/fax_api.rb | 13 +- lib/dropbox-sign/api/fax_line_api.rb | 19 +- lib/dropbox-sign/api/o_auth_api.rb | 6 +- lib/dropbox-sign/api/report_api.rb | 3 +- lib/dropbox-sign/api/signature_request_api.rb | 56 +- lib/dropbox-sign/api/team_api.rb | 28 +- lib/dropbox-sign/api/template_api.rb | 31 +- lib/dropbox-sign/api/unclaimed_draft_api.rb | 12 +- .../models/error_response_error.rb | 2 +- lib/dropbox-sign/version.rb | 2 +- openapi-config.yaml | 2 +- openapi-sdk.yaml | 496 ++++++++++++++---- templates/api.mustache | 3 +- 22 files changed, 550 insertions(+), 176 deletions(-) diff --git a/.travis.yml b/.travis.yml index 2ab25bf..3513cbc 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,4 +8,4 @@ script: - bundle install --path vendor/bundle - bundle exec rspec - gem build dropbox-sign.gemspec - - gem install ./dropbox-sign-1.11.0.gem + - gem install ./dropbox-sign-1.12.0.gem diff --git a/Gemfile.lock b/Gemfile.lock index 5bdd7c8..f368c25 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - dropbox-sign (1.11.0) + dropbox-sign (1.12.0) typhoeus (~> 1.0, >= 1.0.1) GEM diff --git a/README.md b/README.md index 0b9f467..3adb348 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,7 @@ directory that corresponds to the file you want updated. This SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: - API version: 3.0.0 -- Package version: 1.11.0 +- Package version: 1.12.0 - Generator version: 7.12.0 - Build package: org.openapitools.codegen.languages.RubyClientCodegen @@ -47,15 +47,15 @@ gem build dropbox-sign.gemspec Then install the gem locally: ```shell -gem install ./dropbox-sign-1.11.0.gem +gem install ./dropbox-sign-1.12.0.gem ``` -(for development, run `gem install --dev ./dropbox-sign-1.11.0.gem` to install the development dependencies) +(for development, run `gem install --dev ./dropbox-sign-1.12.0.gem` to install the development dependencies) Finally add this to the Gemfile: - gem 'dropbox-sign', '~> 1.11.0' + gem 'dropbox-sign', '~> 1.12.0' ### Install from Git diff --git a/VERSION b/VERSION index 1cac385..0eed1a2 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.11.0 +1.12.0 diff --git a/docs/ErrorResponseError.md b/docs/ErrorResponseError.md index e18e403..21ef5eb 100644 --- a/docs/ErrorResponseError.md +++ b/docs/ErrorResponseError.md @@ -7,6 +7,6 @@ Contains information about an error that occurred. | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | | `error_msg`*_required_ | ```String``` | Message describing an error. | | -| `error_name`*_required_ | ```String``` | Name of the error. | | +| `error_name`*_required_ | ```String``` | Name of the error. See the `x-error-codes` catalog in openapi file for a complete list of possible error codes with detailed information including HTTP status codes, causes, remediation steps, and retry guidance. | | | `error_path` | ```String``` | Path at which an error occurred. | | diff --git a/lib/dropbox-sign/api/account_api.rb b/lib/dropbox-sign/api/account_api.rb index 454dd21..93a66cc 100644 --- a/lib/dropbox-sign/api/account_api.rb +++ b/lib/dropbox-sign/api/account_api.rb @@ -111,7 +111,7 @@ def account_create_with_http_info(account_create_request, opts = {}) range_code = "4XX".split('').first range_code_left = "#{range_code}00".to_i range_code_right = "#{range_code}99".to_i - if e.code >= range_code_left && e.code <= range_code_right + if e.code && e.code >= range_code_left && e.code <= range_code_right body = @api_client.convert_to_type( JSON.parse("[#{e.response_body}]", :symbolize_names => true)[0], "Dropbox::Sign::ErrorResponse" @@ -123,6 +123,7 @@ def account_create_with_http_info(account_create_request, opts = {}) e.message end + raise e end if @api_client.config.debugging @@ -205,7 +206,7 @@ def account_get_with_http_info(opts = {}) range_code = "4XX".split('').first range_code_left = "#{range_code}00".to_i range_code_right = "#{range_code}99".to_i - if e.code >= range_code_left && e.code <= range_code_right + if e.code && e.code >= range_code_left && e.code <= range_code_right body = @api_client.convert_to_type( JSON.parse("[#{e.response_body}]", :symbolize_names => true)[0], "Dropbox::Sign::ErrorResponse" @@ -217,6 +218,7 @@ def account_get_with_http_info(opts = {}) e.message end + raise e end if @api_client.config.debugging @@ -314,7 +316,7 @@ def account_update_with_http_info(account_update_request, opts = {}) range_code = "4XX".split('').first range_code_left = "#{range_code}00".to_i range_code_right = "#{range_code}99".to_i - if e.code >= range_code_left && e.code <= range_code_right + if e.code && e.code >= range_code_left && e.code <= range_code_right body = @api_client.convert_to_type( JSON.parse("[#{e.response_body}]", :symbolize_names => true)[0], "Dropbox::Sign::ErrorResponse" @@ -326,6 +328,7 @@ def account_update_with_http_info(account_update_request, opts = {}) e.message end + raise e end if @api_client.config.debugging @@ -423,7 +426,7 @@ def account_verify_with_http_info(account_verify_request, opts = {}) range_code = "4XX".split('').first range_code_left = "#{range_code}00".to_i range_code_right = "#{range_code}99".to_i - if e.code >= range_code_left && e.code <= range_code_right + if e.code && e.code >= range_code_left && e.code <= range_code_right body = @api_client.convert_to_type( JSON.parse("[#{e.response_body}]", :symbolize_names => true)[0], "Dropbox::Sign::ErrorResponse" @@ -435,6 +438,7 @@ def account_verify_with_http_info(account_verify_request, opts = {}) e.message end + raise e end if @api_client.config.debugging diff --git a/lib/dropbox-sign/api/api_app_api.rb b/lib/dropbox-sign/api/api_app_api.rb index a6fb785..55a35c7 100644 --- a/lib/dropbox-sign/api/api_app_api.rb +++ b/lib/dropbox-sign/api/api_app_api.rb @@ -111,7 +111,7 @@ def api_app_create_with_http_info(api_app_create_request, opts = {}) range_code = "4XX".split('').first range_code_left = "#{range_code}00".to_i range_code_right = "#{range_code}99".to_i - if e.code >= range_code_left && e.code <= range_code_right + if e.code && e.code >= range_code_left && e.code <= range_code_right body = @api_client.convert_to_type( JSON.parse("[#{e.response_body}]", :symbolize_names => true)[0], "Dropbox::Sign::ErrorResponse" @@ -123,6 +123,7 @@ def api_app_create_with_http_info(api_app_create_request, opts = {}) e.message end + raise e end if @api_client.config.debugging @@ -190,6 +191,7 @@ def api_app_delete_with_http_info(client_id, opts = {}) begin data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) rescue Dropbox::Sign::ApiError => e + raise e end if @api_client.config.debugging @@ -272,7 +274,7 @@ def api_app_get_with_http_info(client_id, opts = {}) range_code = "4XX".split('').first range_code_left = "#{range_code}00".to_i range_code_right = "#{range_code}99".to_i - if e.code >= range_code_left && e.code <= range_code_right + if e.code && e.code >= range_code_left && e.code <= range_code_right body = @api_client.convert_to_type( JSON.parse("[#{e.response_body}]", :symbolize_names => true)[0], "Dropbox::Sign::ErrorResponse" @@ -284,6 +286,7 @@ def api_app_get_with_http_info(client_id, opts = {}) e.message end + raise e end if @api_client.config.debugging @@ -366,7 +369,7 @@ def api_app_list_with_http_info(opts = {}) range_code = "4XX".split('').first range_code_left = "#{range_code}00".to_i range_code_right = "#{range_code}99".to_i - if e.code >= range_code_left && e.code <= range_code_right + if e.code && e.code >= range_code_left && e.code <= range_code_right body = @api_client.convert_to_type( JSON.parse("[#{e.response_body}]", :symbolize_names => true)[0], "Dropbox::Sign::ErrorResponse" @@ -378,6 +381,7 @@ def api_app_list_with_http_info(opts = {}) e.message end + raise e end if @api_client.config.debugging @@ -481,7 +485,7 @@ def api_app_update_with_http_info(client_id, api_app_update_request, opts = {}) range_code = "4XX".split('').first range_code_left = "#{range_code}00".to_i range_code_right = "#{range_code}99".to_i - if e.code >= range_code_left && e.code <= range_code_right + if e.code && e.code >= range_code_left && e.code <= range_code_right body = @api_client.convert_to_type( JSON.parse("[#{e.response_body}]", :symbolize_names => true)[0], "Dropbox::Sign::ErrorResponse" @@ -493,6 +497,7 @@ def api_app_update_with_http_info(client_id, api_app_update_request, opts = {}) e.message end + raise e end if @api_client.config.debugging diff --git a/lib/dropbox-sign/api/bulk_send_job_api.rb b/lib/dropbox-sign/api/bulk_send_job_api.rb index 5f62840..69bd200 100644 --- a/lib/dropbox-sign/api/bulk_send_job_api.rb +++ b/lib/dropbox-sign/api/bulk_send_job_api.rb @@ -102,7 +102,7 @@ def bulk_send_job_get_with_http_info(bulk_send_job_id, opts = {}) range_code = "4XX".split('').first range_code_left = "#{range_code}00".to_i range_code_right = "#{range_code}99".to_i - if e.code >= range_code_left && e.code <= range_code_right + if e.code && e.code >= range_code_left && e.code <= range_code_right body = @api_client.convert_to_type( JSON.parse("[#{e.response_body}]", :symbolize_names => true)[0], "Dropbox::Sign::ErrorResponse" @@ -114,6 +114,7 @@ def bulk_send_job_get_with_http_info(bulk_send_job_id, opts = {}) e.message end + raise e end if @api_client.config.debugging @@ -196,7 +197,7 @@ def bulk_send_job_list_with_http_info(opts = {}) range_code = "4XX".split('').first range_code_left = "#{range_code}00".to_i range_code_right = "#{range_code}99".to_i - if e.code >= range_code_left && e.code <= range_code_right + if e.code && e.code >= range_code_left && e.code <= range_code_right body = @api_client.convert_to_type( JSON.parse("[#{e.response_body}]", :symbolize_names => true)[0], "Dropbox::Sign::ErrorResponse" @@ -208,6 +209,7 @@ def bulk_send_job_list_with_http_info(opts = {}) e.message end + raise e end if @api_client.config.debugging diff --git a/lib/dropbox-sign/api/embedded_api.rb b/lib/dropbox-sign/api/embedded_api.rb index 5724c49..efbc7f9 100644 --- a/lib/dropbox-sign/api/embedded_api.rb +++ b/lib/dropbox-sign/api/embedded_api.rb @@ -117,7 +117,7 @@ def embedded_edit_url_with_http_info(template_id, embedded_edit_url_request, opt range_code = "4XX".split('').first range_code_left = "#{range_code}00".to_i range_code_right = "#{range_code}99".to_i - if e.code >= range_code_left && e.code <= range_code_right + if e.code && e.code >= range_code_left && e.code <= range_code_right body = @api_client.convert_to_type( JSON.parse("[#{e.response_body}]", :symbolize_names => true)[0], "Dropbox::Sign::ErrorResponse" @@ -129,6 +129,7 @@ def embedded_edit_url_with_http_info(template_id, embedded_edit_url_request, opt e.message end + raise e end if @api_client.config.debugging @@ -211,7 +212,7 @@ def embedded_sign_url_with_http_info(signature_id, opts = {}) range_code = "4XX".split('').first range_code_left = "#{range_code}00".to_i range_code_right = "#{range_code}99".to_i - if e.code >= range_code_left && e.code <= range_code_right + if e.code && e.code >= range_code_left && e.code <= range_code_right body = @api_client.convert_to_type( JSON.parse("[#{e.response_body}]", :symbolize_names => true)[0], "Dropbox::Sign::ErrorResponse" @@ -223,6 +224,7 @@ def embedded_sign_url_with_http_info(signature_id, opts = {}) e.message end + raise e end if @api_client.config.debugging diff --git a/lib/dropbox-sign/api/fax_api.rb b/lib/dropbox-sign/api/fax_api.rb index aac2bc9..f4cfda3 100644 --- a/lib/dropbox-sign/api/fax_api.rb +++ b/lib/dropbox-sign/api/fax_api.rb @@ -81,6 +81,7 @@ def fax_delete_with_http_info(fax_id, opts = {}) begin data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) rescue Dropbox::Sign::ApiError => e + raise e end if @api_client.config.debugging @@ -163,7 +164,7 @@ def fax_files_with_http_info(fax_id, opts = {}) range_code = "4XX".split('').first range_code_left = "#{range_code}00".to_i range_code_right = "#{range_code}99".to_i - if e.code >= range_code_left && e.code <= range_code_right + if e.code && e.code >= range_code_left && e.code <= range_code_right body = @api_client.convert_to_type( JSON.parse("[#{e.response_body}]", :symbolize_names => true)[0], "Dropbox::Sign::ErrorResponse" @@ -175,6 +176,7 @@ def fax_files_with_http_info(fax_id, opts = {}) e.message end + raise e end if @api_client.config.debugging @@ -257,7 +259,7 @@ def fax_get_with_http_info(fax_id, opts = {}) range_code = "4XX".split('').first range_code_left = "#{range_code}00".to_i range_code_right = "#{range_code}99".to_i - if e.code >= range_code_left && e.code <= range_code_right + if e.code && e.code >= range_code_left && e.code <= range_code_right body = @api_client.convert_to_type( JSON.parse("[#{e.response_body}]", :symbolize_names => true)[0], "Dropbox::Sign::ErrorResponse" @@ -269,6 +271,7 @@ def fax_get_with_http_info(fax_id, opts = {}) e.message end + raise e end if @api_client.config.debugging @@ -363,7 +366,7 @@ def fax_list_with_http_info(opts = {}) range_code = "4XX".split('').first range_code_left = "#{range_code}00".to_i range_code_right = "#{range_code}99".to_i - if e.code >= range_code_left && e.code <= range_code_right + if e.code && e.code >= range_code_left && e.code <= range_code_right body = @api_client.convert_to_type( JSON.parse("[#{e.response_body}]", :symbolize_names => true)[0], "Dropbox::Sign::ErrorResponse" @@ -375,6 +378,7 @@ def fax_list_with_http_info(opts = {}) e.message end + raise e end if @api_client.config.debugging @@ -472,7 +476,7 @@ def fax_send_with_http_info(fax_send_request, opts = {}) range_code = "4XX".split('').first range_code_left = "#{range_code}00".to_i range_code_right = "#{range_code}99".to_i - if e.code >= range_code_left && e.code <= range_code_right + if e.code && e.code >= range_code_left && e.code <= range_code_right body = @api_client.convert_to_type( JSON.parse("[#{e.response_body}]", :symbolize_names => true)[0], "Dropbox::Sign::ErrorResponse" @@ -484,6 +488,7 @@ def fax_send_with_http_info(fax_send_request, opts = {}) e.message end + raise e end if @api_client.config.debugging diff --git a/lib/dropbox-sign/api/fax_line_api.rb b/lib/dropbox-sign/api/fax_line_api.rb index 02d224c..3c8a861 100644 --- a/lib/dropbox-sign/api/fax_line_api.rb +++ b/lib/dropbox-sign/api/fax_line_api.rb @@ -111,7 +111,7 @@ def fax_line_add_user_with_http_info(fax_line_add_user_request, opts = {}) range_code = "4XX".split('').first range_code_left = "#{range_code}00".to_i range_code_right = "#{range_code}99".to_i - if e.code >= range_code_left && e.code <= range_code_right + if e.code && e.code >= range_code_left && e.code <= range_code_right body = @api_client.convert_to_type( JSON.parse("[#{e.response_body}]", :symbolize_names => true)[0], "Dropbox::Sign::ErrorResponse" @@ -123,6 +123,7 @@ def fax_line_add_user_with_http_info(fax_line_add_user_request, opts = {}) e.message end + raise e end if @api_client.config.debugging @@ -228,7 +229,7 @@ def fax_line_area_code_get_with_http_info(country, opts = {}) range_code = "4XX".split('').first range_code_left = "#{range_code}00".to_i range_code_right = "#{range_code}99".to_i - if e.code >= range_code_left && e.code <= range_code_right + if e.code && e.code >= range_code_left && e.code <= range_code_right body = @api_client.convert_to_type( JSON.parse("[#{e.response_body}]", :symbolize_names => true)[0], "Dropbox::Sign::ErrorResponse" @@ -240,6 +241,7 @@ def fax_line_area_code_get_with_http_info(country, opts = {}) e.message end + raise e end if @api_client.config.debugging @@ -337,7 +339,7 @@ def fax_line_create_with_http_info(fax_line_create_request, opts = {}) range_code = "4XX".split('').first range_code_left = "#{range_code}00".to_i range_code_right = "#{range_code}99".to_i - if e.code >= range_code_left && e.code <= range_code_right + if e.code && e.code >= range_code_left && e.code <= range_code_right body = @api_client.convert_to_type( JSON.parse("[#{e.response_body}]", :symbolize_names => true)[0], "Dropbox::Sign::ErrorResponse" @@ -349,6 +351,7 @@ def fax_line_create_with_http_info(fax_line_create_request, opts = {}) e.message end + raise e end if @api_client.config.debugging @@ -431,6 +434,7 @@ def fax_line_delete_with_http_info(fax_line_delete_request, opts = {}) begin data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) rescue Dropbox::Sign::ApiError => e + raise e end if @api_client.config.debugging @@ -514,7 +518,7 @@ def fax_line_get_with_http_info(number, opts = {}) range_code = "4XX".split('').first range_code_left = "#{range_code}00".to_i range_code_right = "#{range_code}99".to_i - if e.code >= range_code_left && e.code <= range_code_right + if e.code && e.code >= range_code_left && e.code <= range_code_right body = @api_client.convert_to_type( JSON.parse("[#{e.response_body}]", :symbolize_names => true)[0], "Dropbox::Sign::ErrorResponse" @@ -526,6 +530,7 @@ def fax_line_get_with_http_info(number, opts = {}) e.message end + raise e end if @api_client.config.debugging @@ -614,7 +619,7 @@ def fax_line_list_with_http_info(opts = {}) range_code = "4XX".split('').first range_code_left = "#{range_code}00".to_i range_code_right = "#{range_code}99".to_i - if e.code >= range_code_left && e.code <= range_code_right + if e.code && e.code >= range_code_left && e.code <= range_code_right body = @api_client.convert_to_type( JSON.parse("[#{e.response_body}]", :symbolize_names => true)[0], "Dropbox::Sign::ErrorResponse" @@ -626,6 +631,7 @@ def fax_line_list_with_http_info(opts = {}) e.message end + raise e end if @api_client.config.debugging @@ -723,7 +729,7 @@ def fax_line_remove_user_with_http_info(fax_line_remove_user_request, opts = {}) range_code = "4XX".split('').first range_code_left = "#{range_code}00".to_i range_code_right = "#{range_code}99".to_i - if e.code >= range_code_left && e.code <= range_code_right + if e.code && e.code >= range_code_left && e.code <= range_code_right body = @api_client.convert_to_type( JSON.parse("[#{e.response_body}]", :symbolize_names => true)[0], "Dropbox::Sign::ErrorResponse" @@ -735,6 +741,7 @@ def fax_line_remove_user_with_http_info(fax_line_remove_user_request, opts = {}) e.message end + raise e end if @api_client.config.debugging diff --git a/lib/dropbox-sign/api/o_auth_api.rb b/lib/dropbox-sign/api/o_auth_api.rb index ae9af5a..24acc4f 100644 --- a/lib/dropbox-sign/api/o_auth_api.rb +++ b/lib/dropbox-sign/api/o_auth_api.rb @@ -111,7 +111,7 @@ def oauth_token_generate_with_http_info(o_auth_token_generate_request, opts = {} range_code = "4XX".split('').first range_code_left = "#{range_code}00".to_i range_code_right = "#{range_code}99".to_i - if e.code >= range_code_left && e.code <= range_code_right + if e.code && e.code >= range_code_left && e.code <= range_code_right body = @api_client.convert_to_type( JSON.parse("[#{e.response_body}]", :symbolize_names => true)[0], "Dropbox::Sign::ErrorResponse" @@ -123,6 +123,7 @@ def oauth_token_generate_with_http_info(o_auth_token_generate_request, opts = {} e.message end + raise e end if @api_client.config.debugging @@ -220,7 +221,7 @@ def oauth_token_refresh_with_http_info(o_auth_token_refresh_request, opts = {}) range_code = "4XX".split('').first range_code_left = "#{range_code}00".to_i range_code_right = "#{range_code}99".to_i - if e.code >= range_code_left && e.code <= range_code_right + if e.code && e.code >= range_code_left && e.code <= range_code_right body = @api_client.convert_to_type( JSON.parse("[#{e.response_body}]", :symbolize_names => true)[0], "Dropbox::Sign::ErrorResponse" @@ -232,6 +233,7 @@ def oauth_token_refresh_with_http_info(o_auth_token_refresh_request, opts = {}) e.message end + raise e end if @api_client.config.debugging diff --git a/lib/dropbox-sign/api/report_api.rb b/lib/dropbox-sign/api/report_api.rb index ee776ff..9bbaf03 100644 --- a/lib/dropbox-sign/api/report_api.rb +++ b/lib/dropbox-sign/api/report_api.rb @@ -111,7 +111,7 @@ def report_create_with_http_info(report_create_request, opts = {}) range_code = "4XX".split('').first range_code_left = "#{range_code}00".to_i range_code_right = "#{range_code}99".to_i - if e.code >= range_code_left && e.code <= range_code_right + if e.code && e.code >= range_code_left && e.code <= range_code_right body = @api_client.convert_to_type( JSON.parse("[#{e.response_body}]", :symbolize_names => true)[0], "Dropbox::Sign::ErrorResponse" @@ -123,6 +123,7 @@ def report_create_with_http_info(report_create_request, opts = {}) e.message end + raise e end if @api_client.config.debugging diff --git a/lib/dropbox-sign/api/signature_request_api.rb b/lib/dropbox-sign/api/signature_request_api.rb index d2b9684..cb68136 100644 --- a/lib/dropbox-sign/api/signature_request_api.rb +++ b/lib/dropbox-sign/api/signature_request_api.rb @@ -111,7 +111,7 @@ def signature_request_bulk_create_embedded_with_template_with_http_info(signatur range_code = "4XX".split('').first range_code_left = "#{range_code}00".to_i range_code_right = "#{range_code}99".to_i - if e.code >= range_code_left && e.code <= range_code_right + if e.code && e.code >= range_code_left && e.code <= range_code_right body = @api_client.convert_to_type( JSON.parse("[#{e.response_body}]", :symbolize_names => true)[0], "Dropbox::Sign::ErrorResponse" @@ -123,6 +123,7 @@ def signature_request_bulk_create_embedded_with_template_with_http_info(signatur e.message end + raise e end if @api_client.config.debugging @@ -220,7 +221,7 @@ def signature_request_bulk_send_with_template_with_http_info(signature_request_b range_code = "4XX".split('').first range_code_left = "#{range_code}00".to_i range_code_right = "#{range_code}99".to_i - if e.code >= range_code_left && e.code <= range_code_right + if e.code && e.code >= range_code_left && e.code <= range_code_right body = @api_client.convert_to_type( JSON.parse("[#{e.response_body}]", :symbolize_names => true)[0], "Dropbox::Sign::ErrorResponse" @@ -232,6 +233,7 @@ def signature_request_bulk_send_with_template_with_http_info(signature_request_b e.message end + raise e end if @api_client.config.debugging @@ -299,6 +301,7 @@ def signature_request_cancel_with_http_info(signature_request_id, opts = {}) begin data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) rescue Dropbox::Sign::ApiError => e + raise e end if @api_client.config.debugging @@ -396,7 +399,7 @@ def signature_request_create_embedded_with_http_info(signature_request_create_em range_code = "4XX".split('').first range_code_left = "#{range_code}00".to_i range_code_right = "#{range_code}99".to_i - if e.code >= range_code_left && e.code <= range_code_right + if e.code && e.code >= range_code_left && e.code <= range_code_right body = @api_client.convert_to_type( JSON.parse("[#{e.response_body}]", :symbolize_names => true)[0], "Dropbox::Sign::ErrorResponse" @@ -408,6 +411,7 @@ def signature_request_create_embedded_with_http_info(signature_request_create_em e.message end + raise e end if @api_client.config.debugging @@ -505,7 +509,7 @@ def signature_request_create_embedded_with_template_with_http_info(signature_req range_code = "4XX".split('').first range_code_left = "#{range_code}00".to_i range_code_right = "#{range_code}99".to_i - if e.code >= range_code_left && e.code <= range_code_right + if e.code && e.code >= range_code_left && e.code <= range_code_right body = @api_client.convert_to_type( JSON.parse("[#{e.response_body}]", :symbolize_names => true)[0], "Dropbox::Sign::ErrorResponse" @@ -517,6 +521,7 @@ def signature_request_create_embedded_with_template_with_http_info(signature_req e.message end + raise e end if @api_client.config.debugging @@ -620,7 +625,7 @@ def signature_request_edit_with_http_info(signature_request_id, signature_reques range_code = "4XX".split('').first range_code_left = "#{range_code}00".to_i range_code_right = "#{range_code}99".to_i - if e.code >= range_code_left && e.code <= range_code_right + if e.code && e.code >= range_code_left && e.code <= range_code_right body = @api_client.convert_to_type( JSON.parse("[#{e.response_body}]", :symbolize_names => true)[0], "Dropbox::Sign::ErrorResponse" @@ -632,6 +637,7 @@ def signature_request_edit_with_http_info(signature_request_id, signature_reques e.message end + raise e end if @api_client.config.debugging @@ -735,7 +741,7 @@ def signature_request_edit_embedded_with_http_info(signature_request_id, signatu range_code = "4XX".split('').first range_code_left = "#{range_code}00".to_i range_code_right = "#{range_code}99".to_i - if e.code >= range_code_left && e.code <= range_code_right + if e.code && e.code >= range_code_left && e.code <= range_code_right body = @api_client.convert_to_type( JSON.parse("[#{e.response_body}]", :symbolize_names => true)[0], "Dropbox::Sign::ErrorResponse" @@ -747,6 +753,7 @@ def signature_request_edit_embedded_with_http_info(signature_request_id, signatu e.message end + raise e end if @api_client.config.debugging @@ -850,7 +857,7 @@ def signature_request_edit_embedded_with_template_with_http_info(signature_reque range_code = "4XX".split('').first range_code_left = "#{range_code}00".to_i range_code_right = "#{range_code}99".to_i - if e.code >= range_code_left && e.code <= range_code_right + if e.code && e.code >= range_code_left && e.code <= range_code_right body = @api_client.convert_to_type( JSON.parse("[#{e.response_body}]", :symbolize_names => true)[0], "Dropbox::Sign::ErrorResponse" @@ -862,6 +869,7 @@ def signature_request_edit_embedded_with_template_with_http_info(signature_reque e.message end + raise e end if @api_client.config.debugging @@ -965,7 +973,7 @@ def signature_request_edit_with_template_with_http_info(signature_request_id, si range_code = "4XX".split('').first range_code_left = "#{range_code}00".to_i range_code_right = "#{range_code}99".to_i - if e.code >= range_code_left && e.code <= range_code_right + if e.code && e.code >= range_code_left && e.code <= range_code_right body = @api_client.convert_to_type( JSON.parse("[#{e.response_body}]", :symbolize_names => true)[0], "Dropbox::Sign::ErrorResponse" @@ -977,6 +985,7 @@ def signature_request_edit_with_template_with_http_info(signature_request_id, si e.message end + raise e end if @api_client.config.debugging @@ -1066,7 +1075,7 @@ def signature_request_files_with_http_info(signature_request_id, opts = {}) range_code = "4XX".split('').first range_code_left = "#{range_code}00".to_i range_code_right = "#{range_code}99".to_i - if e.code >= range_code_left && e.code <= range_code_right + if e.code && e.code >= range_code_left && e.code <= range_code_right body = @api_client.convert_to_type( JSON.parse("[#{e.response_body}]", :symbolize_names => true)[0], "Dropbox::Sign::ErrorResponse" @@ -1078,6 +1087,7 @@ def signature_request_files_with_http_info(signature_request_id, opts = {}) e.message end + raise e end if @api_client.config.debugging @@ -1160,7 +1170,7 @@ def signature_request_files_as_data_uri_with_http_info(signature_request_id, opt range_code = "4XX".split('').first range_code_left = "#{range_code}00".to_i range_code_right = "#{range_code}99".to_i - if e.code >= range_code_left && e.code <= range_code_right + if e.code && e.code >= range_code_left && e.code <= range_code_right body = @api_client.convert_to_type( JSON.parse("[#{e.response_body}]", :symbolize_names => true)[0], "Dropbox::Sign::ErrorResponse" @@ -1172,6 +1182,7 @@ def signature_request_files_as_data_uri_with_http_info(signature_request_id, opt e.message end + raise e end if @api_client.config.debugging @@ -1257,7 +1268,7 @@ def signature_request_files_as_file_url_with_http_info(signature_request_id, opt range_code = "4XX".split('').first range_code_left = "#{range_code}00".to_i range_code_right = "#{range_code}99".to_i - if e.code >= range_code_left && e.code <= range_code_right + if e.code && e.code >= range_code_left && e.code <= range_code_right body = @api_client.convert_to_type( JSON.parse("[#{e.response_body}]", :symbolize_names => true)[0], "Dropbox::Sign::ErrorResponse" @@ -1269,6 +1280,7 @@ def signature_request_files_as_file_url_with_http_info(signature_request_id, opt e.message end + raise e end if @api_client.config.debugging @@ -1351,7 +1363,7 @@ def signature_request_get_with_http_info(signature_request_id, opts = {}) range_code = "4XX".split('').first range_code_left = "#{range_code}00".to_i range_code_right = "#{range_code}99".to_i - if e.code >= range_code_left && e.code <= range_code_right + if e.code && e.code >= range_code_left && e.code <= range_code_right body = @api_client.convert_to_type( JSON.parse("[#{e.response_body}]", :symbolize_names => true)[0], "Dropbox::Sign::ErrorResponse" @@ -1363,6 +1375,7 @@ def signature_request_get_with_http_info(signature_request_id, opts = {}) e.message end + raise e end if @api_client.config.debugging @@ -1451,7 +1464,7 @@ def signature_request_list_with_http_info(opts = {}) range_code = "4XX".split('').first range_code_left = "#{range_code}00".to_i range_code_right = "#{range_code}99".to_i - if e.code >= range_code_left && e.code <= range_code_right + if e.code && e.code >= range_code_left && e.code <= range_code_right body = @api_client.convert_to_type( JSON.parse("[#{e.response_body}]", :symbolize_names => true)[0], "Dropbox::Sign::ErrorResponse" @@ -1463,6 +1476,7 @@ def signature_request_list_with_http_info(opts = {}) e.message end + raise e end if @api_client.config.debugging @@ -1545,7 +1559,7 @@ def signature_request_release_hold_with_http_info(signature_request_id, opts = { range_code = "4XX".split('').first range_code_left = "#{range_code}00".to_i range_code_right = "#{range_code}99".to_i - if e.code >= range_code_left && e.code <= range_code_right + if e.code && e.code >= range_code_left && e.code <= range_code_right body = @api_client.convert_to_type( JSON.parse("[#{e.response_body}]", :symbolize_names => true)[0], "Dropbox::Sign::ErrorResponse" @@ -1557,6 +1571,7 @@ def signature_request_release_hold_with_http_info(signature_request_id, opts = { e.message end + raise e end if @api_client.config.debugging @@ -1660,7 +1675,7 @@ def signature_request_remind_with_http_info(signature_request_id, signature_requ range_code = "4XX".split('').first range_code_left = "#{range_code}00".to_i range_code_right = "#{range_code}99".to_i - if e.code >= range_code_left && e.code <= range_code_right + if e.code && e.code >= range_code_left && e.code <= range_code_right body = @api_client.convert_to_type( JSON.parse("[#{e.response_body}]", :symbolize_names => true)[0], "Dropbox::Sign::ErrorResponse" @@ -1672,6 +1687,7 @@ def signature_request_remind_with_http_info(signature_request_id, signature_requ e.message end + raise e end if @api_client.config.debugging @@ -1739,6 +1755,7 @@ def signature_request_remove_with_http_info(signature_request_id, opts = {}) begin data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) rescue Dropbox::Sign::ApiError => e + raise e end if @api_client.config.debugging @@ -1836,7 +1853,7 @@ def signature_request_send_with_http_info(signature_request_send_request, opts = range_code = "4XX".split('').first range_code_left = "#{range_code}00".to_i range_code_right = "#{range_code}99".to_i - if e.code >= range_code_left && e.code <= range_code_right + if e.code && e.code >= range_code_left && e.code <= range_code_right body = @api_client.convert_to_type( JSON.parse("[#{e.response_body}]", :symbolize_names => true)[0], "Dropbox::Sign::ErrorResponse" @@ -1848,6 +1865,7 @@ def signature_request_send_with_http_info(signature_request_send_request, opts = e.message end + raise e end if @api_client.config.debugging @@ -1945,7 +1963,7 @@ def signature_request_send_with_template_with_http_info(signature_request_send_w range_code = "4XX".split('').first range_code_left = "#{range_code}00".to_i range_code_right = "#{range_code}99".to_i - if e.code >= range_code_left && e.code <= range_code_right + if e.code && e.code >= range_code_left && e.code <= range_code_right body = @api_client.convert_to_type( JSON.parse("[#{e.response_body}]", :symbolize_names => true)[0], "Dropbox::Sign::ErrorResponse" @@ -1957,6 +1975,7 @@ def signature_request_send_with_template_with_http_info(signature_request_send_w e.message end + raise e end if @api_client.config.debugging @@ -2060,7 +2079,7 @@ def signature_request_update_with_http_info(signature_request_id, signature_requ range_code = "4XX".split('').first range_code_left = "#{range_code}00".to_i range_code_right = "#{range_code}99".to_i - if e.code >= range_code_left && e.code <= range_code_right + if e.code && e.code >= range_code_left && e.code <= range_code_right body = @api_client.convert_to_type( JSON.parse("[#{e.response_body}]", :symbolize_names => true)[0], "Dropbox::Sign::ErrorResponse" @@ -2072,6 +2091,7 @@ def signature_request_update_with_http_info(signature_request_id, signature_requ e.message end + raise e end if @api_client.config.debugging diff --git a/lib/dropbox-sign/api/team_api.rb b/lib/dropbox-sign/api/team_api.rb index 1002a2d..4fbe8cb 100644 --- a/lib/dropbox-sign/api/team_api.rb +++ b/lib/dropbox-sign/api/team_api.rb @@ -114,7 +114,7 @@ def team_add_member_with_http_info(team_add_member_request, opts = {}) range_code = "4XX".split('').first range_code_left = "#{range_code}00".to_i range_code_right = "#{range_code}99".to_i - if e.code >= range_code_left && e.code <= range_code_right + if e.code && e.code >= range_code_left && e.code <= range_code_right body = @api_client.convert_to_type( JSON.parse("[#{e.response_body}]", :symbolize_names => true)[0], "Dropbox::Sign::ErrorResponse" @@ -126,6 +126,7 @@ def team_add_member_with_http_info(team_add_member_request, opts = {}) e.message end + raise e end if @api_client.config.debugging @@ -223,7 +224,7 @@ def team_create_with_http_info(team_create_request, opts = {}) range_code = "4XX".split('').first range_code_left = "#{range_code}00".to_i range_code_right = "#{range_code}99".to_i - if e.code >= range_code_left && e.code <= range_code_right + if e.code && e.code >= range_code_left && e.code <= range_code_right body = @api_client.convert_to_type( JSON.parse("[#{e.response_body}]", :symbolize_names => true)[0], "Dropbox::Sign::ErrorResponse" @@ -235,6 +236,7 @@ def team_create_with_http_info(team_create_request, opts = {}) e.message end + raise e end if @api_client.config.debugging @@ -296,6 +298,7 @@ def team_delete_with_http_info(opts = {}) begin data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) rescue Dropbox::Sign::ApiError => e + raise e end if @api_client.config.debugging @@ -372,7 +375,7 @@ def team_get_with_http_info(opts = {}) range_code = "4XX".split('').first range_code_left = "#{range_code}00".to_i range_code_right = "#{range_code}99".to_i - if e.code >= range_code_left && e.code <= range_code_right + if e.code && e.code >= range_code_left && e.code <= range_code_right body = @api_client.convert_to_type( JSON.parse("[#{e.response_body}]", :symbolize_names => true)[0], "Dropbox::Sign::ErrorResponse" @@ -384,6 +387,7 @@ def team_get_with_http_info(opts = {}) e.message end + raise e end if @api_client.config.debugging @@ -463,7 +467,7 @@ def team_info_with_http_info(opts = {}) range_code = "4XX".split('').first range_code_left = "#{range_code}00".to_i range_code_right = "#{range_code}99".to_i - if e.code >= range_code_left && e.code <= range_code_right + if e.code && e.code >= range_code_left && e.code <= range_code_right body = @api_client.convert_to_type( JSON.parse("[#{e.response_body}]", :symbolize_names => true)[0], "Dropbox::Sign::ErrorResponse" @@ -475,6 +479,7 @@ def team_info_with_http_info(opts = {}) e.message end + raise e end if @api_client.config.debugging @@ -554,7 +559,7 @@ def team_invites_with_http_info(opts = {}) range_code = "4XX".split('').first range_code_left = "#{range_code}00".to_i range_code_right = "#{range_code}99".to_i - if e.code >= range_code_left && e.code <= range_code_right + if e.code && e.code >= range_code_left && e.code <= range_code_right body = @api_client.convert_to_type( JSON.parse("[#{e.response_body}]", :symbolize_names => true)[0], "Dropbox::Sign::ErrorResponse" @@ -566,6 +571,7 @@ def team_invites_with_http_info(opts = {}) e.message end + raise e end if @api_client.config.debugging @@ -662,7 +668,7 @@ def team_members_with_http_info(team_id, opts = {}) range_code = "4XX".split('').first range_code_left = "#{range_code}00".to_i range_code_right = "#{range_code}99".to_i - if e.code >= range_code_left && e.code <= range_code_right + if e.code && e.code >= range_code_left && e.code <= range_code_right body = @api_client.convert_to_type( JSON.parse("[#{e.response_body}]", :symbolize_names => true)[0], "Dropbox::Sign::ErrorResponse" @@ -674,6 +680,7 @@ def team_members_with_http_info(team_id, opts = {}) e.message end + raise e end if @api_client.config.debugging @@ -771,7 +778,7 @@ def team_remove_member_with_http_info(team_remove_member_request, opts = {}) range_code = "4XX".split('').first range_code_left = "#{range_code}00".to_i range_code_right = "#{range_code}99".to_i - if e.code >= range_code_left && e.code <= range_code_right + if e.code && e.code >= range_code_left && e.code <= range_code_right body = @api_client.convert_to_type( JSON.parse("[#{e.response_body}]", :symbolize_names => true)[0], "Dropbox::Sign::ErrorResponse" @@ -783,6 +790,7 @@ def team_remove_member_with_http_info(team_remove_member_request, opts = {}) e.message end + raise e end if @api_client.config.debugging @@ -879,7 +887,7 @@ def team_sub_teams_with_http_info(team_id, opts = {}) range_code = "4XX".split('').first range_code_left = "#{range_code}00".to_i range_code_right = "#{range_code}99".to_i - if e.code >= range_code_left && e.code <= range_code_right + if e.code && e.code >= range_code_left && e.code <= range_code_right body = @api_client.convert_to_type( JSON.parse("[#{e.response_body}]", :symbolize_names => true)[0], "Dropbox::Sign::ErrorResponse" @@ -891,6 +899,7 @@ def team_sub_teams_with_http_info(team_id, opts = {}) e.message end + raise e end if @api_client.config.debugging @@ -988,7 +997,7 @@ def team_update_with_http_info(team_update_request, opts = {}) range_code = "4XX".split('').first range_code_left = "#{range_code}00".to_i range_code_right = "#{range_code}99".to_i - if e.code >= range_code_left && e.code <= range_code_right + if e.code && e.code >= range_code_left && e.code <= range_code_right body = @api_client.convert_to_type( JSON.parse("[#{e.response_body}]", :symbolize_names => true)[0], "Dropbox::Sign::ErrorResponse" @@ -1000,6 +1009,7 @@ def team_update_with_http_info(team_update_request, opts = {}) e.message end + raise e end if @api_client.config.debugging diff --git a/lib/dropbox-sign/api/template_api.rb b/lib/dropbox-sign/api/template_api.rb index c43bf9e..a649223 100644 --- a/lib/dropbox-sign/api/template_api.rb +++ b/lib/dropbox-sign/api/template_api.rb @@ -117,7 +117,7 @@ def template_add_user_with_http_info(template_id, template_add_user_request, opt range_code = "4XX".split('').first range_code_left = "#{range_code}00".to_i range_code_right = "#{range_code}99".to_i - if e.code >= range_code_left && e.code <= range_code_right + if e.code && e.code >= range_code_left && e.code <= range_code_right body = @api_client.convert_to_type( JSON.parse("[#{e.response_body}]", :symbolize_names => true)[0], "Dropbox::Sign::ErrorResponse" @@ -129,6 +129,7 @@ def template_add_user_with_http_info(template_id, template_add_user_request, opt e.message end + raise e end if @api_client.config.debugging @@ -226,7 +227,7 @@ def template_create_with_http_info(template_create_request, opts = {}) range_code = "4XX".split('').first range_code_left = "#{range_code}00".to_i range_code_right = "#{range_code}99".to_i - if e.code >= range_code_left && e.code <= range_code_right + if e.code && e.code >= range_code_left && e.code <= range_code_right body = @api_client.convert_to_type( JSON.parse("[#{e.response_body}]", :symbolize_names => true)[0], "Dropbox::Sign::ErrorResponse" @@ -238,6 +239,7 @@ def template_create_with_http_info(template_create_request, opts = {}) e.message end + raise e end if @api_client.config.debugging @@ -335,7 +337,7 @@ def template_create_embedded_draft_with_http_info(template_create_embedded_draft range_code = "4XX".split('').first range_code_left = "#{range_code}00".to_i range_code_right = "#{range_code}99".to_i - if e.code >= range_code_left && e.code <= range_code_right + if e.code && e.code >= range_code_left && e.code <= range_code_right body = @api_client.convert_to_type( JSON.parse("[#{e.response_body}]", :symbolize_names => true)[0], "Dropbox::Sign::ErrorResponse" @@ -347,6 +349,7 @@ def template_create_embedded_draft_with_http_info(template_create_embedded_draft e.message end + raise e end if @api_client.config.debugging @@ -414,6 +417,7 @@ def template_delete_with_http_info(template_id, opts = {}) begin data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) rescue Dropbox::Sign::ApiError => e + raise e end if @api_client.config.debugging @@ -503,7 +507,7 @@ def template_files_with_http_info(template_id, opts = {}) range_code = "4XX".split('').first range_code_left = "#{range_code}00".to_i range_code_right = "#{range_code}99".to_i - if e.code >= range_code_left && e.code <= range_code_right + if e.code && e.code >= range_code_left && e.code <= range_code_right body = @api_client.convert_to_type( JSON.parse("[#{e.response_body}]", :symbolize_names => true)[0], "Dropbox::Sign::ErrorResponse" @@ -515,6 +519,7 @@ def template_files_with_http_info(template_id, opts = {}) e.message end + raise e end if @api_client.config.debugging @@ -597,7 +602,7 @@ def template_files_as_data_uri_with_http_info(template_id, opts = {}) range_code = "4XX".split('').first range_code_left = "#{range_code}00".to_i range_code_right = "#{range_code}99".to_i - if e.code >= range_code_left && e.code <= range_code_right + if e.code && e.code >= range_code_left && e.code <= range_code_right body = @api_client.convert_to_type( JSON.parse("[#{e.response_body}]", :symbolize_names => true)[0], "Dropbox::Sign::ErrorResponse" @@ -609,6 +614,7 @@ def template_files_as_data_uri_with_http_info(template_id, opts = {}) e.message end + raise e end if @api_client.config.debugging @@ -694,7 +700,7 @@ def template_files_as_file_url_with_http_info(template_id, opts = {}) range_code = "4XX".split('').first range_code_left = "#{range_code}00".to_i range_code_right = "#{range_code}99".to_i - if e.code >= range_code_left && e.code <= range_code_right + if e.code && e.code >= range_code_left && e.code <= range_code_right body = @api_client.convert_to_type( JSON.parse("[#{e.response_body}]", :symbolize_names => true)[0], "Dropbox::Sign::ErrorResponse" @@ -706,6 +712,7 @@ def template_files_as_file_url_with_http_info(template_id, opts = {}) e.message end + raise e end if @api_client.config.debugging @@ -788,7 +795,7 @@ def template_get_with_http_info(template_id, opts = {}) range_code = "4XX".split('').first range_code_left = "#{range_code}00".to_i range_code_right = "#{range_code}99".to_i - if e.code >= range_code_left && e.code <= range_code_right + if e.code && e.code >= range_code_left && e.code <= range_code_right body = @api_client.convert_to_type( JSON.parse("[#{e.response_body}]", :symbolize_names => true)[0], "Dropbox::Sign::ErrorResponse" @@ -800,6 +807,7 @@ def template_get_with_http_info(template_id, opts = {}) e.message end + raise e end if @api_client.config.debugging @@ -896,7 +904,7 @@ def template_list_with_http_info(opts = {}) range_code = "4XX".split('').first range_code_left = "#{range_code}00".to_i range_code_right = "#{range_code}99".to_i - if e.code >= range_code_left && e.code <= range_code_right + if e.code && e.code >= range_code_left && e.code <= range_code_right body = @api_client.convert_to_type( JSON.parse("[#{e.response_body}]", :symbolize_names => true)[0], "Dropbox::Sign::ErrorResponse" @@ -908,6 +916,7 @@ def template_list_with_http_info(opts = {}) e.message end + raise e end if @api_client.config.debugging @@ -1011,7 +1020,7 @@ def template_remove_user_with_http_info(template_id, template_remove_user_reques range_code = "4XX".split('').first range_code_left = "#{range_code}00".to_i range_code_right = "#{range_code}99".to_i - if e.code >= range_code_left && e.code <= range_code_right + if e.code && e.code >= range_code_left && e.code <= range_code_right body = @api_client.convert_to_type( JSON.parse("[#{e.response_body}]", :symbolize_names => true)[0], "Dropbox::Sign::ErrorResponse" @@ -1023,6 +1032,7 @@ def template_remove_user_with_http_info(template_id, template_remove_user_reques e.message end + raise e end if @api_client.config.debugging @@ -1126,7 +1136,7 @@ def template_update_files_with_http_info(template_id, template_update_files_requ range_code = "4XX".split('').first range_code_left = "#{range_code}00".to_i range_code_right = "#{range_code}99".to_i - if e.code >= range_code_left && e.code <= range_code_right + if e.code && e.code >= range_code_left && e.code <= range_code_right body = @api_client.convert_to_type( JSON.parse("[#{e.response_body}]", :symbolize_names => true)[0], "Dropbox::Sign::ErrorResponse" @@ -1138,6 +1148,7 @@ def template_update_files_with_http_info(template_id, template_update_files_requ e.message end + raise e end if @api_client.config.debugging diff --git a/lib/dropbox-sign/api/unclaimed_draft_api.rb b/lib/dropbox-sign/api/unclaimed_draft_api.rb index 53ede89..bf6e158 100644 --- a/lib/dropbox-sign/api/unclaimed_draft_api.rb +++ b/lib/dropbox-sign/api/unclaimed_draft_api.rb @@ -111,7 +111,7 @@ def unclaimed_draft_create_with_http_info(unclaimed_draft_create_request, opts = range_code = "4XX".split('').first range_code_left = "#{range_code}00".to_i range_code_right = "#{range_code}99".to_i - if e.code >= range_code_left && e.code <= range_code_right + if e.code && e.code >= range_code_left && e.code <= range_code_right body = @api_client.convert_to_type( JSON.parse("[#{e.response_body}]", :symbolize_names => true)[0], "Dropbox::Sign::ErrorResponse" @@ -123,6 +123,7 @@ def unclaimed_draft_create_with_http_info(unclaimed_draft_create_request, opts = e.message end + raise e end if @api_client.config.debugging @@ -220,7 +221,7 @@ def unclaimed_draft_create_embedded_with_http_info(unclaimed_draft_create_embedd range_code = "4XX".split('').first range_code_left = "#{range_code}00".to_i range_code_right = "#{range_code}99".to_i - if e.code >= range_code_left && e.code <= range_code_right + if e.code && e.code >= range_code_left && e.code <= range_code_right body = @api_client.convert_to_type( JSON.parse("[#{e.response_body}]", :symbolize_names => true)[0], "Dropbox::Sign::ErrorResponse" @@ -232,6 +233,7 @@ def unclaimed_draft_create_embedded_with_http_info(unclaimed_draft_create_embedd e.message end + raise e end if @api_client.config.debugging @@ -329,7 +331,7 @@ def unclaimed_draft_create_embedded_with_template_with_http_info(unclaimed_draft range_code = "4XX".split('').first range_code_left = "#{range_code}00".to_i range_code_right = "#{range_code}99".to_i - if e.code >= range_code_left && e.code <= range_code_right + if e.code && e.code >= range_code_left && e.code <= range_code_right body = @api_client.convert_to_type( JSON.parse("[#{e.response_body}]", :symbolize_names => true)[0], "Dropbox::Sign::ErrorResponse" @@ -341,6 +343,7 @@ def unclaimed_draft_create_embedded_with_template_with_http_info(unclaimed_draft e.message end + raise e end if @api_client.config.debugging @@ -444,7 +447,7 @@ def unclaimed_draft_edit_and_resend_with_http_info(signature_request_id, unclaim range_code = "4XX".split('').first range_code_left = "#{range_code}00".to_i range_code_right = "#{range_code}99".to_i - if e.code >= range_code_left && e.code <= range_code_right + if e.code && e.code >= range_code_left && e.code <= range_code_right body = @api_client.convert_to_type( JSON.parse("[#{e.response_body}]", :symbolize_names => true)[0], "Dropbox::Sign::ErrorResponse" @@ -456,6 +459,7 @@ def unclaimed_draft_edit_and_resend_with_http_info(signature_request_id, unclaim e.message end + raise e end if @api_client.config.debugging diff --git a/lib/dropbox-sign/models/error_response_error.rb b/lib/dropbox-sign/models/error_response_error.rb index b1b85ff..baf8d72 100644 --- a/lib/dropbox-sign/models/error_response_error.rb +++ b/lib/dropbox-sign/models/error_response_error.rb @@ -23,7 +23,7 @@ class ErrorResponseError # @return [String] attr_accessor :error_msg - # Name of the error. + # Name of the error. See the `x-error-codes` catalog in openapi file for a complete list of possible error codes with detailed information including HTTP status codes, causes, remediation steps, and retry guidance. # @return [String] attr_accessor :error_name diff --git a/lib/dropbox-sign/version.rb b/lib/dropbox-sign/version.rb index 872214b..e4c0bb5 100644 --- a/lib/dropbox-sign/version.rb +++ b/lib/dropbox-sign/version.rb @@ -14,5 +14,5 @@ module Dropbox end module Dropbox::Sign - VERSION = '1.11.0' + VERSION = '1.12.0' end diff --git a/openapi-config.yaml b/openapi-config.yaml index 94b9709..1ce77f4 100644 --- a/openapi-config.yaml +++ b/openapi-config.yaml @@ -9,7 +9,7 @@ additionalProperties: gemName: dropbox-sign gemRequiredRubyVersion: '>= 2.7' moduleName: "Dropbox::Sign" - gemVersion: 1.11.0 + gemVersion: 1.12.0 sortModelPropertiesByRequiredFlag: true legacyDiscriminatorBehavior: true gitUserId: hellosign diff --git a/openapi-sdk.yaml b/openapi-sdk.yaml index ed174d3..389363e 100644 --- a/openapi-sdk.yaml +++ b/openapi-sdk.yaml @@ -5087,6 +5087,8 @@ paths: $ref: '#/components/examples/Error429Response' 404_example: $ref: '#/components/examples/Error404Response' + 409_example: + $ref: '#/components/examples/Error409Response' 4XX_example: $ref: '#/components/examples/Error4XXResponse' security: @@ -11943,7 +11945,7 @@ components: description: 'Path at which an error occurred.' type: string error_name: - description: 'Name of the error.' + description: 'Name of the error. See the `x-error-codes` catalog in openapi file for a complete list of possible error codes with detailed information including HTTP status codes, causes, remediation steps, and retry guidance.' type: string type: object FaxResponse: @@ -13745,6 +13747,8 @@ components: template: $ref: '#/components/schemas/TemplateResponse' type: object + x-fern-audiences: + - events EventCallbackRequestEvent: description: 'Basic information about the event that occurred.' required: @@ -13788,6 +13792,8 @@ components: event_metadata: $ref: '#/components/schemas/EventCallbackRequestEventMetadata' type: object + x-fern-audiences: + - events EventCallbackRequestEventMetadata: description: 'Specific metadata about the event.' properties: @@ -13808,6 +13814,8 @@ components: type: string nullable: true type: object + x-fern-audiences: + - events responses: EventCallbackResponse: description: 'successful operation' @@ -13816,6 +13824,8 @@ components: schema: type: string default: 'Hello API Event Received' + x-fern-audiences: + - events examples: AccountCreateRequest: summary: 'Default Example' @@ -14317,22 +14327,170 @@ components: summary: 'Example: signature_request_sent' value: $ref: examples/json/EventCallbackAccountSignatureRequestSent.json + x-fern-audiences: + - events EventCallbackAccountTemplateCreated: summary: 'Example: template_created' value: $ref: examples/json/EventCallbackAccountTemplateCreated.json + x-fern-audiences: + - events EventCallbackAppAccountConfirmed: summary: 'Example: account_confirmed' value: $ref: examples/json/EventCallbackAppAccountConfirmed.json + x-fern-audiences: + - events EventCallbackAppSignatureRequestSent: summary: 'Example: signature_request_sent' value: $ref: examples/json/EventCallbackAppSignatureRequestSent.json + x-fern-audiences: + - events EventCallbackAppTemplateCreated: summary: 'Example: template_created' value: $ref: examples/json/EventCallbackAppTemplateCreated.json + x-fern-audiences: + - events + EventCallbackSignatureRequestViewed: + summary: 'Signature Request Viewed Event Example' + value: + $ref: examples/json/EventCallbackSignatureRequestViewed.json + x-fern-audiences: + - events + EventCallbackSignatureRequestSigned: + summary: 'Signature Request Signed Event Example' + value: + $ref: examples/json/EventCallbackSignatureRequestSigned.json + x-fern-audiences: + - events + EventCallbackSignatureRequestSignerRemoved: + summary: 'Signature Request Signer Removed Event Example' + value: + $ref: examples/json/EventCallbackSignatureRequestSignerRemoved.json + x-fern-audiences: + - events + EventCallbackSignatureRequestDownloadable: + summary: 'Signature Request Downloadable Event Example' + value: + $ref: examples/json/EventCallbackSignatureRequestDownloadable.json + x-fern-audiences: + - events + EventCallbackSignatureRequestSent: + summary: 'Signature Request Sent Event Example' + value: + $ref: examples/json/EventCallbackSignatureRequestSent.json + x-fern-audiences: + - events + EventCallbackSignatureRequestAllSigned: + summary: 'Signature Request All Signed Event Example' + value: + $ref: examples/json/EventCallbackSignatureRequestAllSigned.json + x-fern-audiences: + - events + EventCallbackSignatureRequestInvalid: + summary: 'Signature Request Invalid Event Example' + value: + $ref: examples/json/EventCallbackSignatureRequestInvalid.json + x-fern-audiences: + - events + EventCallbackSignatureRequestEmailBounce: + summary: 'Signature Request Email Bounce Event Example' + value: + $ref: examples/json/EventCallbackSignatureRequestEmailBounce.json + x-fern-audiences: + - events + EventCallbackSignatureRequestRemind: + summary: 'Signature Request Remind Event Example' + value: + $ref: examples/json/EventCallbackSignatureRequestRemind.json + x-fern-audiences: + - events + EventCallbackSignatureRequestIncompleteQes: + summary: 'Signature Request Incomplete QES Event Example' + value: + $ref: examples/json/EventCallbackSignatureRequestIncompleteQes.json + x-fern-audiences: + - events + EventCallbackSignatureRequestDestroyed: + summary: 'Signature Request Destroyed Event Example' + value: + $ref: examples/json/EventCallbackSignatureRequestDestroyed.json + x-fern-audiences: + - events + EventCallbackSignatureRequestCanceled: + summary: 'Signature Request Canceled Event Example' + value: + $ref: examples/json/EventCallbackSignatureRequestCanceled.json + x-fern-audiences: + - events + EventCallbackSignatureRequestDeclined: + summary: 'Signature Request Declined Event Example' + value: + $ref: examples/json/EventCallbackSignatureRequestDeclined.json + x-fern-audiences: + - events + EventCallbackSignatureRequestExpired: + summary: 'Signature Request Expired Event Example' + value: + $ref: examples/json/EventCallbackSignatureRequestExpired.json + x-fern-audiences: + - events + EventCallbackSignatureRequestReassigned: + summary: 'Signature Request Reassigned Event Example' + value: + $ref: examples/json/EventCallbackSignatureRequestReassigned.json + x-fern-audiences: + - events + EventCallbackSignatureRequestPrepared: + summary: 'Signature Request Prepared Event Example' + value: + $ref: examples/json/EventCallbackSignatureRequestPrepared.json + x-fern-audiences: + - events + EventCallbackAccountConfirmed: + summary: 'Account Confirmed Event Example' + value: + $ref: examples/json/EventCallbackAccountConfirmed.json + x-fern-audiences: + - events + EventCallbackUnknownError: + summary: 'Unknown Error Event Example' + value: + $ref: examples/json/EventCallbackUnknownError.json + x-fern-audiences: + - events + EventCallbackFileError: + summary: 'File Error Event Example' + value: + $ref: examples/json/EventCallbackFileError.json + x-fern-audiences: + - events + EventCallbackTemplateCreated: + summary: 'Template Created Event Example' + value: + $ref: examples/json/EventCallbackTemplateCreated.json + x-fern-audiences: + - events + EventCallbackTemplateError: + summary: 'Template Error Event Example' + value: + $ref: examples/json/EventCallbackTemplateError.json + x-fern-audiences: + - events + EventCallbackSignUrlInvalid: + summary: 'Sign URL Invalid Event Example' + value: + $ref: examples/json/EventCallbackSignUrlInvalid.json + x-fern-audiences: + - events + EventCallbackCallbackTest: + summary: 'Callback Test Event Example' + value: + $ref: examples/json/EventCallbackCallbackTest.json + x-fern-audiences: + - events requestBodies: EventCallbackAccountRequest: description: |- @@ -14410,100 +14568,242 @@ security: externalDocs: description: 'Legacy API Reference' url: 'https://app.hellosign.com/api/reference' -x-webhooks: - accountCallback: - post: - summary: 'Account Callbacks' - operationId: accountUpdateEventCallback - description: - $ref: ./markdown/en/descriptions/account-callback-description.md - x-meta: - seo: - title: 'Account Callbacks | API Documentation | Dropbox Sign for Developers' - description: 'The Dropbox Sign API allows you to build with a wide range of tools. To find out how to consume Dropbox Sign Events at the account level, click here.' - x-codeSamples: - - - lang: PHP - label: PHP - source: - $ref: examples/EventCallbackExample.php - - - lang: 'C#' - label: 'C#' - source: - $ref: examples/EventCallbackExample.cs - - - lang: TypeScript - label: TypeScript - source: - $ref: examples/EventCallbackExample.ts - - - lang: Java - label: Java - source: - $ref: examples/EventCallbackExample.java - - - lang: Ruby - label: Ruby - source: - $ref: examples/EventCallbackExample.rb - - - lang: Python - label: Python - source: - $ref: examples/EventCallbackExample.py - tags: - - 'Callbacks and Events' - requestBody: - $ref: '#/components/requestBodies/EventCallbackAccountRequest' - responses: - 200: - $ref: '#/components/responses/EventCallbackResponse' - appCallback: - post: - summary: 'App Callbacks' - description: - $ref: ./markdown/en/descriptions/api-app-callback-description.md - operationId: apiAppCreateEventCallback - x-meta: - seo: - title: 'App Callbacks | API Documentation | Dropbox Sign for Developers' - description: 'The Dropbox Sign API allows you to build with a wide range of tools. To find out how to consume Dropbox Sign Events at the App level, click here.' - x-codeSamples: - - - lang: PHP - label: PHP - source: - $ref: examples/EventCallbackExample.php - - - lang: 'C#' - label: 'C#' - source: - $ref: examples/EventCallbackExample.cs - - - lang: TypeScript - label: TypeScript - source: - $ref: examples/EventCallbackExample.ts - - - lang: Java - label: Java - source: - $ref: examples/EventCallbackExample.java - - - lang: Ruby - label: Ruby - source: - $ref: examples/EventCallbackExample.rb - - - lang: Python - label: Python - source: - $ref: examples/EventCallbackExample.py - tags: - - 'Callbacks and Events' - requestBody: - $ref: '#/components/requestBodies/EventCallbackAppRequest' - responses: - 200: - $ref: '#/components/responses/EventCallbackResponse' +x-webhooks: [] +x-error-codes: + bad_request: + http_status: 400 + summary: 'The request contained invalid or malformed parameters.' + cause: 'A parameter failed validation, or the request body was malformed.' + remediation: 'Inspect error_msg and error_path, correct the offending parameter, and resend.' + retryable: 'no' + unauthorized: + http_status: 401 + summary: 'The credentials supplied are missing or invalid.' + cause: 'Missing, malformed, or invalid API key or OAuth access token.' + remediation: 'Verify the API key or OAuth token and the Authorization header, then retry.' + retryable: 'no' + payment_required: + http_status: 402 + summary: 'The account must be credited or upgraded to perform this action.' + cause: 'The action requires a paid plan, additional quota, or API credits.' + remediation: 'Upgrade the plan or add the required credits/quota, then retry.' + retryable: 'no' + forbidden: + http_status: 403 + summary: 'The action is not allowed for these credentials or in the current context.' + cause: 'The authenticated account lacks access to the resource or operation.' + remediation: 'Confirm the account has access to the resource and the required permissions.' + retryable: 'no' + not_found: + http_status: 404 + summary: 'Nothing matches the requested resource.' + cause: 'The resource id does not exist or is not visible to this account.' + remediation: 'Verify the id and that the resource belongs to the authenticated account.' + retryable: 'no' + conflict: + http_status: 409 + summary: 'The request was well-formed but conflicts with the current state.' + cause: 'The target resource is in a state incompatible with the request (e.g. a signature request is still being set up).' + remediation: 'Wait briefly and retry, or listen for a callback event confirming the resource is ready.' + retryable: conditional + exceeded_rate: + http_status: 429 + summary: 'Your account''s API request rate limit has been exceeded.' + cause: 'Too many requests were sent within the rate-limit window for this request type.' + remediation: 'Pace requests using the X-RateLimit-* response headers and retry after the window resets.' + retryable: 'yes' + backoff: 'Honor X-Ratelimit-Reset (Unix epoch); otherwise exponential backoff with jitter. No Retry-After header is sent.' + unknown: + http_status: 500 + summary: 'An unexpected error occurred.' + cause: 'An unhandled server-side error, or a status code without a more specific error_name.' + remediation: 'Retry transient failures; if it persists, contact support with the request details.' + retryable: conditional + backoff: 'For transient 5xx, retry with exponential backoff; otherwise do not retry.' + team_invite_failed: + http_status: 403 + summary: 'The team invitation could not be completed.' + cause: 'The invitee already belongs to a team, or the invite is otherwise not permitted.' + remediation: 'Confirm the invitee is not already on a team before inviting.' + retryable: 'no' + max_faxes: + http_status: 429 + summary: 'Too many fax transmissions are currently pending or transmitting.' + cause: 'The account has reached the limit of concurrent in-flight fax transmissions.' + remediation: 'Wait for outstanding transmissions to complete, then retry.' + retryable: 'yes' + backoff: 'Retry with exponential backoff once pending transmissions clear.' + invalid_recipient: + http_status: 400 + summary: 'The recipient (fax number or email address) is invalid.' + cause: 'A recipient value did not pass validation.' + remediation: 'Correct the recipient value and resend.' + retryable: 'no' + signature_request_cancel_failed: + http_status: 400 + summary: 'The signature request could not be cancelled.' + cause: 'The caller is not the requester, or the request is already fully executed/closed.' + remediation: 'Only the requester can cancel, and only before the request is fully executed.' + retryable: 'no' + signature_request_remove_failed: + http_status: 400 + summary: 'Access to the signature request could not be removed.' + cause: 'The signature request has not yet been fully executed, so access cannot be revoked.' + remediation: 'Wait until all parties have signed, or call /signature_request/cancel to cancel incomplete requests instead.' + retryable: 'no' + maintenance: + http_status: 503 + summary: 'The request could not be completed because the site is under maintenance.' + cause: 'The API is in a scheduled maintenance window.' + remediation: 'Retry once the maintenance window ends.' + retryable: 'yes' + backoff: 'Retry later with exponential backoff.' + method_not_supported: + http_status: 405 + summary: 'The HTTP method is not supported for this endpoint.' + cause: 'The request used a verb the endpoint does not accept.' + remediation: 'Use the HTTP method documented for the endpoint.' + retryable: 'no' + invalid_reminder: + http_status: 400 + summary: 'The signature request reminder was invalid.' + cause: 'A reminder was attempted against an ineligible request (e.g. embedded, closed, or expired).' + remediation: 'Only send reminders for eligible (non-embedded, open) signature requests.' + retryable: 'no' + unavailable: + http_status: 503 + summary: 'The service is temporarily unavailable.' + cause: 'A downstream dependency or the service itself is temporarily unavailable.' + remediation: 'Retry later with exponential backoff.' + retryable: 'yes' + backoff: 'Retry later with exponential backoff and jitter.' + unprocessable_entity: + http_status: 422 + summary: 'The request was understood but the target entity cannot be processed.' + cause: 'The resource is still being processed, or it is in an error state.' + remediation: 'If the resource is still processing, wait and retry; if it is in an error state, recreate/resend it instead of retrying.' + retryable: conditional + backoff: 'If still processing, retry with exponential backoff; if in an error state, do not retry.' + signature_request_expired: + http_status: + - 400 + - 403 + summary: 'The signature request has expired.' + cause: 'The operation targets a request whose expiration has passed. Most endpoints return 400; final-copy/download endpoints return 403.' + remediation: 'The request can no longer be acted upon; create a new signature request.' + retryable: 'no' + deleted: + http_status: 410 + summary: 'The request was cancelled or deleted.' + cause: 'The resource has been cancelled or removed and is no longer available.' + remediation: 'Do not retry; the resource is permanently gone.' + retryable: 'no' +x-oauth-error-codes: + invalid_grant: + http_status: + - 400 + - 401 + summary: 'The OAuth grant (authorization code or refresh token) is invalid or expired.' + cause: 'The code/token was already used, expired, or does not match the client.' + remediation: 'Re-initiate the OAuth flow to obtain a fresh authorization code.' + retryable: 'no' + invalid_client: + http_status: 400 + summary: 'The OAuth client credentials are invalid.' + cause: 'The client_id or client_secret is unrecognized or incorrect.' + remediation: 'Verify the client_id and client_secret from the API app settings.' + retryable: 'no' + invalid_request: + http_status: 400 + summary: 'The OAuth request is malformed or missing required parameters.' + cause: 'A required parameter is missing, or the request format is invalid.' + remediation: 'Check the request against the OAuth token endpoint documentation.' + retryable: 'no' + unauthorized_client: + http_status: + - 401 + - 403 + summary: 'The OAuth client is not authorized to perform this action.' + cause: 'The app has not been approved, or the action is outside the granted scopes.' + remediation: 'Ensure the app is approved and the required scopes are granted.' + retryable: 'no' + unsupported_grant_type: + http_status: 400 + summary: 'The grant type is not supported.' + cause: 'The grant_type parameter value is not recognized.' + remediation: 'Use authorization_code or refresh_token as the grant_type.' + retryable: 'no' + payment_required: + http_status: 402 + summary: 'The account requires a paid plan to use this OAuth app.' + cause: 'The authorizing account does not have a plan that supports this integration.' + remediation: 'Upgrade the account to a plan that includes OAuth app access.' + retryable: 'no' + addon_required: + http_status: 402 + summary: 'An add-on is required to use this OAuth app.' + cause: 'The account plan does not include the add-on needed for this integration.' + remediation: 'Add the required add-on to the account subscription.' + retryable: 'no' + invalid_scope: + http_status: 400 + summary: 'The requested OAuth scope is invalid.' + cause: 'The scope parameter contains values not permitted for the app.' + remediation: 'Request only scopes that the app is configured to use.' + retryable: 'no' + quota_reached: + http_status: 402 + summary: 'The account has reached its usage quota for this OAuth app.' + cause: 'The authorizing account has exhausted its quota for the integration.' + remediation: 'Contact the app owner or upgrade the account quota.' + retryable: 'no' + server_error: + http_status: 500 + summary: 'An internal server error occurred during OAuth processing.' + cause: 'An unexpected error on the server side while handling the OAuth request.' + remediation: 'Retry the request; if it persists, contact support.' + retryable: 'yes' + backoff: 'Retry with exponential backoff.' + temporary_unavailable: + http_status: 503 + summary: 'The OAuth service is temporarily unavailable.' + cause: 'The service is under maintenance or experiencing temporary issues.' + remediation: 'Retry after a short delay.' + retryable: 'yes' + backoff: 'Retry with exponential backoff.' +x-error-events: + signature_request_invalid: + event_type: signature_request_invalid + delivery: webhook + summary: 'Asynchronous error while processing a signature request.' + cause: 'A signature request could not be processed (e.g. invalid tags, fields, or merge data).' + remediation: 'Inspect event.event_metadata.event_message in the callback, correct the request, and resend.' + retryable: conditional + unknown_error: + event_type: unknown_error + delivery: webhook + summary: 'An unspecified asynchronous processing error occurred.' + cause: 'An unexpected error occurred while processing the request asynchronously.' + remediation: 'Check the request status in the API dashboard; retry or contact support if it persists.' + retryable: conditional + file_error: + event_type: file_error + delivery: webhook + summary: 'Asynchronous error while processing an uploaded file.' + cause: 'A file attached to a request could not be processed.' + remediation: 'Resend the request with a supported, non-corrupt file.' + retryable: conditional + template_error: + event_type: template_error + delivery: webhook + summary: 'Asynchronous error while creating a template.' + cause: 'Template file processing failed (e.g. unsupported or corrupt file).' + remediation: 'Recreate the template with a valid file; check status in the API dashboard.' + retryable: conditional + sign_url_invalid: + event_type: sign_url_invalid + delivery: webhook + summary: 'An embedded signing URL has expired or become invalid.' + cause: 'The embedded sign_url is no longer valid (e.g. expired).' + remediation: 'Generate a fresh embedded sign_url via the embedded sign URL endpoint.' + retryable: 'yes' diff --git a/templates/api.mustache b/templates/api.mustache index e5611a3..cade90e 100644 --- a/templates/api.mustache +++ b/templates/api.mustache @@ -307,7 +307,7 @@ module {{moduleName}} range_code_left = "#{range_code}00".to_i range_code_right = "#{range_code}99".to_i <%={{ }}=%> - if e.code >= range_code_left && e.code <= range_code_right + if e.code && e.code >= range_code_left && e.code <= range_code_right body = @api_client.convert_to_type( JSON.parse("[#{e.response_body}]", :symbolize_names => true)[0], "{{moduleName}}::{{{dataType}}}" @@ -338,6 +338,7 @@ module {{moduleName}} {{/dataType}} {{/responses}} {{/returnType}} + raise e end {{/useCustomTemplateCode}} From 349a0f3b6cf77b8c0e9db4b518f75c8e6abf345e Mon Sep 17 00:00:00 2001 From: Andrzej Danilowski Date: Wed, 22 Jul 2026 08:47:07 +0200 Subject: [PATCH 2/2] Release 1.12.0 --- spec/api/error_handling_spec.rb | 73 +++++++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 spec/api/error_handling_spec.rb diff --git a/spec/api/error_handling_spec.rb b/spec/api/error_handling_spec.rb new file mode 100644 index 0000000..b584600 --- /dev/null +++ b/spec/api/error_handling_spec.rb @@ -0,0 +1,73 @@ +=begin +#Dropbox Sign API + +#Dropbox Sign v3 API + +The version of the OpenAPI document: 3.0.0 +Contact: apisupport@hellosign.com +Generated by: https://openapi-generator.tech +Generator version: 7.12.0 + +=end + +require 'spec_helper' +require_relative '../test_utils' + +describe 'Error Handling' do + context 'ApiError propagation' do + api = Dropbox::Sign::AccountApi.new + + it 'raises ApiError for 5XX server errors' do + set_expected_response(500, '{"error":{"error_msg":"Internal server error","error_name":"server_error"}}') + + expect { + api.account_get({ email_address: "test@example.com" }) + }.to raise_error(Dropbox::Sign::ApiError) { |e| + expect(e.code).to eq(500) + } + end + + it 'raises ApiError for 503 server errors' do + set_expected_response(503, '{"error":{"error_msg":"Service unavailable","error_name":"service_unavailable"}}') + + expect { + api.account_get({ email_address: "test@example.com" }) + }.to raise_error(Dropbox::Sign::ApiError) { |e| + expect(e.code).to eq(503) + } + end + + it 'raises ApiError for connection failures' do + Typhoeus.stub(/hellosign.com/) do + Typhoeus::Response.new( + :code => 0, + :return_message => "Connection refused" + ) + end + + expect { + api.account_get({ email_address: "test@example.com" }) + }.to raise_error(Dropbox::Sign::ApiError) { |e| + expect(e.code).to eq(0) + } + end + + it 'raises ApiError for timeout errors' do + Typhoeus.stub(/hellosign.com/) do + response = Typhoeus::Response.new( + :code => 0, + :return_message => "Timeout was reached", + :mock => true + ) + response.instance_variable_set(:@options, response.instance_variable_get(:@options).merge(return_code: :operation_timedout)) + response + end + + expect { + api.account_get({ email_address: "test@example.com" }) + }.to raise_error(Dropbox::Sign::ApiError) { |e| + expect(e.message).to include("timed out") + } + end + end +end