-
Notifications
You must be signed in to change notification settings - Fork 2
CatBox Client Abstraction & Error Handling #4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
ChaseDRedmon
commented
May 6, 2023
- Organize Requests and Clients into subfolders;
- Rename CreateAlbumRequest.cs to RemoteCreateAlbumRequest.cs.
- Add LocalCreateAlbumRequest.cs to create albums on catbox while uploading local files.
- Create abstraction for Local and Remote Requests: AlbumCreationRequest.cs.
- Begin work on CatBox client abstraction layer and created a method to upload files and create an album in one step.
- Working on better error handling from the API side of things.
…est.cs to RemoteCreateAlbumRequest.cs. Add LocalCreateAlbumRequest.cs to create albums on catbox while uploading local files. Create abstraction for Local and Remote Requests: AlbumCreationRequest.cs. Begin work on CatBox client abstraction layer and created a method to upload files and create an album in one step. Working on better error handling from the API side of things.
…thods for uploading files and creating albums.
…t doesn't already exist
…matting, variable renaming, etc. Add upload to album request type. Renamed some request types. Trying out AnyOf request type to simplify API usage
…aks to Delegating Handler for exception throwing
…eter code. Remove ToRequest methods that converted Enums to API equivalent request values. Add AddHttpClientWithMessageHandler extension method to clean up service registration. Code comments. Code organization.
…f union type. Add AnyOf dependency. Add IAlbumUploadRequest.cs to abstract CreateAlbumRequest.cs and UploadToAlbumRequest.cs. Remove redundant upload methods in CatBox.cs. Rename Upload methods in CatBoxClient.cs. Change return type CatBoxClient.UplaodImage to IAsyncEnumerable<string?> instead of Task<string?>.
Will work on a list of breaking changes from 0.3 -> 0.4 later on |
public static void IfNull([DoesNotReturnIf(true)] object? s, [CallerArgumentExpression("s")] string memberName = "") | ||
{ | ||
if (s is null) throw new ArgumentNullException(memberName, "Argument cannot be null"); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could just do
public static void IfNull([DoesNotReturnIf(true)] object? s, [CallerArgumentExpression("s")] string memberName = "")
{
ArgumentNullException.ThrowIfNull(s, memberName);
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since the library includes a minimum target to .NET Standard 2.1 (the minimum version for C# 8 to support async-enumerables), the ArgumentNullException.ThrowIfNull
isn't present in the BCL at this point. That was added in a later version of .NET
Latest feedback has been taken into consideration and committed into codebase |