question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

SQL Exception for request and responses

See original GitHub issue

I implemented this package for logging in my Web API application to monitor logs here is my configurations in my service collection : services.AddWatchDogServices(opt => { opt.ClearTimeSchedule = WatchDogAutoClearScheduleEnum.Monthly; opt.IsAutoClear = true; opt.SqlDriverOption = WatchDogSqlDriverEnum.MSSQL; opt.SetExternalDbConnString = Configuration.GetConnectionString("DefaultConnection"); });

and here is my appBuilder configuration : app.UseWatchDogExceptionLogger(); app.UseWatchDog(opt => { opt.WatchPageUsername = "xxxx"; opt.WatchPagePassword = "xxxx"; }); For any request and response that is success and returns correct value, I have got exception as below What I’m missing in implementation ? Why Logging is not working correctly ?

at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action1 wrapCloseInAction) at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action1 wrapCloseInAction) at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose) at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady) at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString) at System.Data.SqlClient.SqlCommand.CompleteAsyncExecuteReader() at System.Data.SqlClient.SqlCommand.EndExecuteNonQueryInternal(IAsyncResult asyncResult) at System.Data.SqlClient.SqlCommand.EndExecuteNonQuery(IAsyncResult asyncResult) at System.Threading.Tasks.TaskFactory1.FromAsyncCoreLogic(IAsyncResult iar, Func2 endFunction, Action1 endAction, Task1 promise, Boolean requiresSynchronization) --- End of stack trace from previous location --- at Dapper.SqlMapper.ExecuteImplAsync(IDbConnection cnn, CommandDefinition command, Object param) in /_/Dapper/SqlMapper.Async.cs:line 646 at WatchDog.src.Helpers.ExternalDbHelper.InsertWatchLog(WatchLog log) at WatchDog.src.Managers.DynamicDBManager.InsertWatchLog(WatchLog log) at WatchDog.src.WatchDog.InvokeAsync(HttpContext context) at WatchDog.src.WatchDogExceptionLogger.InvokeAsync(HttpContext context)

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
IzyProcommented, Sep 18, 2022

@devFarshadFahimi @ksarankumar A new version (v1.3.2) with the fix has been released. Update the WatchDog.NET package in your project and you should be good to go.

1reaction
IzyProcommented, Sep 15, 2022

Great, that has already been fixed and a new version will be deployed soon.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to implement error handling in SQL Server
This article explains how to implement SQL error handling using the SQL server try-catch statement and what can be done in general when...
Read more >
JDBC Exception Handling - How To Handle SQL Exceptions
This JDBC Exception Handling tutorial explains ways to handle SQL Exceptions with the help of programming examples.
Read more >
Handling SQLExceptions - JDBC Basics
When JDBC encounters an error during an interaction with a data source, it throws an instance of SQLException as opposed to Exception ....
Read more >
Handling Exceptions and Error responses in Java Rest Services
The database service tries to execute an SQL query but it fails. This happens a lot in the real world. The query could...
Read more >
What response code should we send on exception
The Exception you send back depends on a few things. First, did the user send you bad information? Or did your server screw...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found