/// <summary> /// Persist information about the specified <paramref name="ex">exception</paramref> to the data store and return /// the ID that is assigned to it. /// </summary> /// <param name="ex">The exception to be recorded to the data store.</param> /// <returns>Returns an integer that uniquely identifies this application error (<see cref="IAppError.AppErrorId"/>).</returns> public static int Record(Exception ex) { IAppError appError = new AppError(ex); SendEmail(appError); int appErrorId = DataProviderManager.Provider.AppError_Save(appError); ValidateLogSize(); return appErrorId; }
/// <summary> /// Persist information about the specified <paramref name="ex">exception</paramref> to the data store and return /// the ID that is assigned to it. /// </summary> /// <param name="ex">The exception to be recorded to the data store.</param> /// <returns>Returns an integer that uniquely identifies this application error (<see cref="IAppError.AppErrorId"/>).</returns> public static int Record(Exception ex) { IAppError appError = new AppError(ex); SendEmail(appError); int appErrorId = DataProviderManager.Provider.AppError_Save(appError); ValidateLogSize(); return(appErrorId); }
/// <summary> /// Persist information about the specified <paramref name="ex">exception</paramref> to the data store and return /// the ID that is assigned to it. Send an e-mail notification if that option is enabled. /// </summary> /// <param name="ex">The exception to be recorded to the data store.</param> /// <param name="galleryId">The ID of the gallery the <paramref name="ex">exception</paramref> is associated with. /// If the exception is not specific to a particular gallery, specify <see cref="Int32.MinValue"/>.</param> /// <param name="gallerySettingsCollection">The collection of gallery settings for all galleries. You may specify /// null if the value is not known. This value must be specified for e-mail notification to occur.</param> /// <param name="appSettings">The application settings. You may specify null if the value is not known.</param> /// <returns> /// Returns an integer that uniquely identifies this application error (<see cref="IAppError.AppErrorId"/>). /// </returns> /// <exception cref="ArgumentNullException">Thrown when <paramref name="ex"/> is null.</exception> public static int Record(Exception ex, int galleryId, IGallerySettingsCollection gallerySettingsCollection, IAppSetting appSettings) { if (ex == null) { throw new ArgumentNullException("ex"); } IAppError appError = new AppError(ex, galleryId); int appErrorId = DataProviderManager.Provider.AppError_Save(appError); if (gallerySettingsCollection != null) { SendEmail(appError, gallerySettingsCollection); } if (appSettings != null) { ValidateLogSize(appSettings.MaxNumberErrorItems); } return(appErrorId); }
/// <summary> /// Persist information about the specified <paramref name="ex">exception</paramref> to the data store and return /// the ID that is assigned to it. Send an e-mail notification if that option is enabled. /// </summary> /// <param name="ex">The exception to be recorded to the data store.</param> /// <param name="galleryId">The ID of the gallery the <paramref name="ex">exception</paramref> is associated with. /// If the exception is not specific to a particular gallery, specify <see cref="Int32.MinValue"/>.</param> /// <param name="gallerySettingsCollection">The collection of gallery settings for all galleries. You may specify /// null if the value is not known. This value must be specified for e-mail notification to occur.</param> /// <param name="appSettings">The application settings. You may specify null if the value is not known.</param> /// <returns> /// Returns an integer that uniquely identifies this application error (<see cref="IAppError.AppErrorId"/>). /// </returns> /// <exception cref="ArgumentNullException">Thrown when <paramref name="ex"/> is null.</exception> public static int Record(Exception ex, int galleryId, IGallerySettingsCollection gallerySettingsCollection, IAppSetting appSettings) { if (ex == null) throw new ArgumentNullException("ex"); IAppError appError = new AppError(ex, galleryId); int appErrorId = DataProviderManager.Provider.AppError_Save(appError); if (gallerySettingsCollection != null) { SendEmail(appError, gallerySettingsCollection); } if (appSettings != null) { ValidateLogSize(appSettings.MaxNumberErrorItems); } return appErrorId; }