镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

Document exceptions correctly #1110

Closed
Closed

Description

@antonfirsov
  • Image.Load overloads are marked as throwing UnknownImageFormatException however when the image content is incorrect, we throw ImageFormatException instead. We should consider defining, utilizing and documenting a new InvalidImageContentException for these cases. Alternatively we can just make the xmldocs to refer to ImageFormatException, as an easier solution, but having a separate ImageFormatException subclass seems more correct to me.
  • In Image.FromFile.cs and Image.FromBytes.cs we do not document the above exceptions at all.
  • ImageProcessingException is not documented on the API surface. I would suggest to add it to: Mutate, Clone and IImageProcessor<TPixel>.Execute, however I haven't analyzed the call hierarchy whether it is the correct thing to do.
  • Review our API if there are any other missing exception docs.

If we decide to indroduce InvalidImageContentException, that part should be probably done for RC1, since it is a breaking change.

Activity

  1. changed the title [-]Document exceptions properly[/-] [+]Document exceptions correctly[/+] on Feb 9, 2020
  2. added this to the 1.0.0-rc1 milestone on Mar 13, 2020
  3. antonfirsov commented on Mar 13, 2020

    @antonfirsov
    MemberAuthor

    Also noticed that many Image.Load overloads and other public methods are not validating their input at all.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions