Skip to content

Commit

Permalink
feat(exceptions): updating how exceptions are handled and removing un…
Browse files Browse the repository at this point in the history
…used interfaces (#96)

BREAKING CHANGES: changed the exceptions returned from all services to GeoNETException instead of individual exceptions per API, as well as removed some now-deprecated interface types and implementations
  • Loading branch information
JustinCanton authored Jan 22, 2024
1 parent e108ec6 commit 61a3e5f
Show file tree
Hide file tree
Showing 63 changed files with 802 additions and 1,413 deletions.
8 changes: 5 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,16 @@

All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org/) for commit guidelines.

## [2.0.0](https://github.com/JustinCanton/Geo.NET/compare/1.6.0...2.0.0) (2024-01-20)
## [2.0.0](https://github.com/JustinCanton/Geo.NET/compare/1.6.0...2.0.0) (2024-01-30)
### ⚠ BREAKING CHANGES
- removed native support for net5.0 since it is an out of support item, and dropped netstandard2.1 since this supports netstandard2.0
- removed the usage of Newtonsoft.Json and now uses on System.Text.Json
- removed the usage of Newtonsoft.Json and moved to use System.Text.Json
- changed the exceptions returned from all services to GeoNETException instead of individual exceptions per API, as well as removed some now-deprecated interface types and implementations

### Features
- **runtime**: updating the .net version support for net8.0, and removing native support for netstandard2.1 and net5.0 ([#58](https://github.com/JustinCanton/Geo.NET/issues/58)) ([4398a10](https://github.com/JustinCanton/Geo.NET/commit/4398a10afb21d3e7e86fba0fa4052adb67ca1faa))
- **serialization**: updating to use System.Text.Json instead of Newtonsoft.Json ([#40](https://github.com/JustinCanton/Geo.NET/issues/40)) ([4398a10](https://github.com/JustinCanton/Geo.NET/commit/4398a10afb21d3e7e86fba0fa4052adb67ca1faa))
- **serialization**: updating to use System.Text.Json instead of Newtonsoft.Json ([#40](https://github.com/JustinCanton/Geo.NET/issues/40)) ([e108ec6](https://github.com/JustinCanton/Geo.NET/commit/e108ec65d895d8d7fa792845973f14cdcc7335ae))
- **exceptions**: updating how exceptions are handled and removing unused interfaces ([#95](https://github.com/JustinCanton/Geo.NET/issues/95)) ([e108ec6](https://github.com/JustinCanton/Geo.NET/commit/e108ec65d895d8d7fa792845973f14cdcc7335ae))

## [1.6.0](https://github.com/JustinCanton/Geo.NET/compare/1.5.2...1.6.0) (2023-12-29)
### Features
Expand Down
12 changes: 6 additions & 6 deletions src/Geo.ArcGIS/Abstractions/IArcGISGeocoding.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ namespace Geo.ArcGIS.Abstractions
{
using System.Threading;
using System.Threading.Tasks;
using Geo.ArcGIS.Models.Exceptions;
using Geo.ArcGIS.Models.Parameters;
using Geo.ArcGIS.Models.Responses;
using Geo.Core.Models.Exceptions;

/// <summary>
/// An interface for calling the ArcGIS geocoding API.
Expand All @@ -22,7 +22,7 @@ public interface IArcGISGeocoding
/// <param name="parameters">A <see cref="AddressCandidateParameters"/> with the parameters of the request.</param>
/// <param name="cancellationToken">A <see cref="CancellationToken"/> used to cancel the request.</param>
/// <returns>A <see cref="CandidateResponse"/> with the response from ArcGIS.</returns>
/// <exception cref="ArcGISException">Thrown for multiple different reasons. Check the inner exception for more information.</exception>
/// <exception cref="GeoNETException">Thrown for multiple different reasons. Check the inner exception for more information.</exception>
Task<CandidateResponse> AddressCandidateAsync(AddressCandidateParameters parameters, CancellationToken cancellationToken = default);

/// <summary>
Expand All @@ -31,7 +31,7 @@ public interface IArcGISGeocoding
/// <param name="parameters">A <see cref="PlaceCandidateParameters"/> with the parameters of the request.</param>
/// <param name="cancellationToken">A <see cref="CancellationToken"/> used to cancel the request.</param>
/// <returns>A <see cref="CandidateResponse"/> with the response from ArcGIS.</returns>
/// <exception cref="ArcGISException">Thrown for multiple different reasons. Check the inner exception for more information.</exception>
/// <exception cref="GeoNETException">Thrown for multiple different reasons. Check the inner exception for more information.</exception>
Task<CandidateResponse> PlaceCandidateAsync(PlaceCandidateParameters parameters, CancellationToken cancellationToken = default);

/// <summary>
Expand All @@ -40,7 +40,7 @@ public interface IArcGISGeocoding
/// <param name="parameters">A <see cref="SuggestParameters"/> with the parameters of the request.</param>
/// <param name="cancellationToken">A <see cref="CancellationToken"/> used to cancel the request.</param>
/// <returns>A <see cref="SuggestResponse"/> with the response from ArcGIS.</returns>
/// <exception cref="ArcGISException">Thrown for multiple different reasons. Check the inner exception for more information.</exception>
/// <exception cref="GeoNETException">Thrown for multiple different reasons. Check the inner exception for more information.</exception>
Task<SuggestResponse> SuggestAsync(SuggestParameters parameters, CancellationToken cancellationToken = default);

/// <summary>
Expand All @@ -49,7 +49,7 @@ public interface IArcGISGeocoding
/// <param name="parameters">A <see cref="ReverseGeocodingParameters"/> with the parameters of the request.</param>
/// <param name="cancellationToken">A <see cref="CancellationToken"/> used to cancel the request.</param>
/// <returns>A <see cref="ReverseGeocodingResponse"/> with the response from ArcGIS.</returns>
/// <exception cref="ArcGISException">Thrown for multiple different reasons. Check the inner exception for more information.</exception>
/// <exception cref="GeoNETException">Thrown for multiple different reasons. Check the inner exception for more information.</exception>
Task<ReverseGeocodingResponse> ReverseGeocodingAsync(ReverseGeocodingParameters parameters, CancellationToken cancellationToken = default);

/// <summary>
Expand All @@ -58,7 +58,7 @@ public interface IArcGISGeocoding
/// <param name="parameters">A <see cref="GeocodingParameters"/> with the parameters of the request.</param>
/// <param name="cancellationToken">A <see cref="CancellationToken"/> used to cancel the request.</param>
/// <returns>A <see cref="GeocodingResponse"/> with the response from ArcGIS.</returns>
/// <exception cref="ArcGISException">Thrown for multiple different reasons. Check the inner exception for more information.</exception>
/// <exception cref="GeoNETException">Thrown for multiple different reasons. Check the inner exception for more information.</exception>
Task<GeocodingResponse> GeocodingAsync(GeocodingParameters parameters, CancellationToken cancellationToken = default);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ namespace Geo.ArcGIS.DependencyInjection
using Geo.ArcGIS.Abstractions;
using Geo.ArcGIS.Models;
using Geo.ArcGIS.Services;
using Geo.Core.DependencyInjection;
using Microsoft.Extensions.DependencyInjection;

/// <summary>
Expand All @@ -37,8 +36,6 @@ public static IHttpClientBuilder AddArcGISServices(
Action<ArcGISOptionsBuilder> optionsBuilder,
Action<HttpClient> configureClient = null)
{
services.AddCoreServices();

if (optionsBuilder != null)
{
var options = new ArcGISOptionsBuilder();
Expand Down
8 changes: 8 additions & 0 deletions src/Geo.ArcGIS/Geo.ArcGIS.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<RepositoryUrl>https://github.com/JustinCanton/Geo.NET</RepositoryUrl>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<PackageReadmeFile>README.md</PackageReadmeFile>
</PropertyGroup>

<Import Project="..\Source.props" />
Expand All @@ -33,4 +34,11 @@
</EmbeddedResource>
</ItemGroup>

<ItemGroup>
<None Update="README.md">
<Pack>True</Pack>
<PackagePath>\</PackagePath>
</None>
</ItemGroup>

</Project>
56 changes: 0 additions & 56 deletions src/Geo.ArcGIS/Models/Exceptions/ArcGISException.cs

This file was deleted.

Loading

0 comments on commit 61a3e5f

Please sign in to comment.