keboola / db-extractor-mssql

MIT License
1 stars 2 forks source link

Truncation error should be a user exception #98

Open pivnicek opened 5 years ago

pivnicek commented 5 years ago
PDOException:SQLSTATE[42000]: [Microsoft][ODBC Driver 17 for SQL Server][SQL Server]A .NET Framework error occurred during execution of user-defined routine or aggregate \"geography\":  System.Data.SqlServer.TruncationException: Trying to convert return value or output parameter of size 72 bytes to a T-SQL type with a smaller size limit of 60 bytes. System.Data.SqlServer.TruncationException:     at System.Data.SqlServer.Internal.CXVariantBase.StringToWSTR(String pstrValue, Int64 cbMaxLength, Int32 iOffset, EPadding ePad)

Trace

{\"errFile\":\"\/code\/vendor\/keboola\/db-extractor-common\/src\/Keboola\/DbExtractor\/Extractor\/Extractor.php\",\"errLine\":289,\"errCode\":\"42000\",\"errTrace\":\"#0 \/code\/vendor\/keboola\/db-extractor-common\/src\/Keboola\/DbExtractor\/Extractor\/Extractor.php(289): PDOStatement->fetch(2)\\n#1 \/code\/src\/Keboola\/DbExtractor\/Extractor\/MSSQL.php(228): Keboola\\\\DbExtractor\\\\Extractor\\\\Extractor->writeToCsv(Object(PDOStatement), Object(Keboola\\\\Csv\\\\CsvFile), true)\\n#2 \/code\/vendor\/keboola\/db-extractor-common\/src\/Keboola\/DbExtractor\/Application.php(170): Keboola\\\\DbExtractor\\\\Extractor\\\\MSSQL->export(Array)\\n#3 \/code\/vendor\/keboola\/db-extractor-common\/src\/Keboola\/DbExtractor\/Application.php(65): Keboola\\\\DbExtractor\\\\Application->runAction()\\n#4 \/code\/src\/run.php(55): Keboola\\\\DbExtractor\\\\Application->run()\\n#5 {main}\",\"errPrevious\":\"\"} 
pivnicek commented 5 years ago

should throw a user exception.