Commit 4ea829d
committed
(FM-8879) Handle T-SQL Errors Properly
The previous commit that improved T-SQL error handling was incomplete.
That commit (9b8a0fe) was not able to
overcome an important issue.
The issue was that if there was a successfull row insert into a table
the `Errors` collection of the ADODB.Connection would be empty, even
if an error was deliberately thrown using the `THROW` keyword.
It turns out that the successfull row insert was causing a text return
value, and it's a known issue that if values are returned to the object
that the Errors collection will be empty.
We know now that turning `SET NOCOUNT ON` in the beginning of the query
will suppress that text status message and allow more errors to be
properly detected in the ADODB.Connect object, and handled properly
in the module's `onlyif` clause.1 parent 8d44d62 commit 4ea829d
3 files changed
Lines changed: 34 additions & 2 deletions
File tree
- lib/puppet/property
- spec
- acceptance
- unit/puppet/property
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
162 | 162 | | |
163 | 163 | | |
164 | 164 | | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
165 | 196 | | |
166 | 197 | | |
167 | 198 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
17 | | - | |
| 16 | + | |
| 17 | + | |
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| |||
0 commit comments