I have an FSX script which includes a type provider. When the script is run, I would like to show a user-friendly message when the type provider throws an exception. (For example, when the SqlDataProvider
cannot connect to the database.)
Is that possible?
This obviously won't work, but illustrates the idea:
type Sql =
try
SqlDataProvider< DatabaseVendor = databaseVendor, ConnectionString = connectionString, TableNames = tableNames >
with ex ->
printfn "Cannot connect to the database."
Here is a gist that can be used to test potential solutions.