SpectrumFileOpenException.Constructor
Creates the exception for a file that could not be opened.
Remarks
Nova’s readers throw this exception themselves; code using them catches it rather than constructing one. The message reads “Failed to open ‘<fileName>’: <detail>”.
Syntax
| Syntax | Description |
|---|---|
| SpectrumFileOpenException(string fileName, string detail) | Creates the exception for a file that could not be opened. |
| SpectrumFileOpenException(string fileName, string detail, Exception innerException) | Creates the exception for a file that could not be opened, wrapping the exception that caused it. |
Parameters
| Name | Type | Description |
|---|---|---|
| fileName | string | The file that could not be opened. |
| detail | string | Why, as reported by the reader. |
| innerException | Exception | The exception that caused the failure. |
Example
1
2
3
4
5
6
7
8
9
10
11
using Nova.Io.Read;
try
{
FileReader reader = new FileReader();
reader.ReadSpectrum("Damaged.mzML");
}
catch (SpectrumFileOpenException ex)
{
Console.WriteLine(ex.FileName + ": " + ex.Message);
}
This post is licensed under CC BY 4.0 by the author.