title: Making a custom Exception with parameters
body: <p>I'm trying to make a custom exception, the only thing that this custom Exception has to do is to change the message of the exception but have all the attributes of the original exception.</p>
  
  <p>The idea is that the message will change based on the parameter I send.</p>
  
  <pre><code>public class ServiceDireccionException : Exception
  {
  
      public ServiceDireccionException(string type) : base(GetMessage(type)) { }
  
      public enum TypeOfService
      {
          Provincia,
          Municipio,
          Localidad
      }
  
      private static string GetMessage(string type)
      {
          string message = "";
  
          switch (type)
          {
              case nameof(TypeOfService.Provincia):
                  message = ("Sucedio un error al buscar la/s" + TypeOfService.Provincia.ToString() + "/s");
                  break;
  
              case nameof(TypeOfService.Municipio):
                  message = ("Sucedio un error al buscar lo/s" + TypeOfService.Municipio.ToString() + "/s");
                  break;
  
              case nameof(TypeOfService.Localidad):
                  message = ("Sucedio un error al buscar la/s" + TypeOfService.Localidad.ToString() + "/es");
                  break;
          }
  
          return message;
      }
  
  }
  </code></pre>
  
  <p>When I want to use it in a <code>try catch</code> I can't pass the argument:</p>
  
  <pre><code>    catch (ServiceDireccionException ex) //&lt;-- It does not prompt me to pass a string.
      {
          throw ex;
      }
  </code></pre>