Skip to content

[API Proposal]: public ctor for CookieException with string parameter #95965

@mateusz-dobrowolny

Description

@mateusz-dobrowolny

Background and motivation

CDD - Cookie Driven Development

API Proposal

namespace System.Net
{
    [Serializable]
    [...]
    
    public class CookieException : FormatException, ISerializable
    {
        public CookieException() : base()
        {
        }

        // Please make this public
        public CookieException(string? message) : base(message)
        {
        }

Please change access modifier for ctor with string? to public.

API Usage

throw new CookieException("🥮");
throw new CookieException("🍥");
throw new CookieException("🍪");
throw new CookieException("🍩");
throw new CookieException("🍰");

Alternative Designs

Alternatively make it protected, so I still can initialize CookieException with particular cookie.

Risks

Instance of CookieMonster may appear unexpectedly.

Metadata

Metadata

Assignees

Labels

api-approvedAPI was approved in API review, it can be implementedarea-System.Netin-prThere is an active PR which will close this issue when it is merged

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions