Error in C#

lokiys

Moderator
Регистрация
01.02.2012
Сообщения
4 771
Благодарностей
1 184
Баллы
113
I have template with many c# snippets but there is a lot of code in those snippets like 100+ lines in each of them. And when I'm getting error i can not know where error happened.

Basically i would like to get error line that would be the best way. Tried different online available ways but did not find any working for zenno.

Thanks
 

enrc66

Client
Регистрация
12.10.2013
Сообщения
89
Благодарностей
8
Баллы
8
set value to the variable in c#,to trace the error,

this is my way to find the error area :(
 

lokiys

Moderator
Регистрация
01.02.2012
Сообщения
4 771
Благодарностей
1 184
Баллы
113

enrc66

Client
Регистрация
12.10.2013
Сообщения
89
Благодарностей
8
Баллы
8
project.Variables["flag"].Value=1
project.Variables["flag"].Value=2
.....
put them in different c# action,check the flag value to find the last area to excute

a little tedious
 

enrc66

Client
Регистрация
12.10.2013
Сообщения
89
Благодарностей
8
Баллы
8
or put them in one c# action
 

lokiys

Moderator
Регистрация
01.02.2012
Сообщения
4 771
Благодарностей
1 184
Баллы
113
Not sure i understood you right but if right then you mean i should add those variables like 100 in one c# action to find what area gives me error ?

If yes then i can use simple return and get that error there. But this is not very good way, i do not want to make my 100 lines code with 200 lines :D
If i understood wrong then sorry :-)
 

enrc66

Client
Регистрация
12.10.2013
Сообщения
89
Благодарностей
8
Баллы
8
wait for a better way:bp::bo:
 

lokiys

Moderator
Регистрация
01.02.2012
Сообщения
4 771
Благодарностей
1 184
Баллы
113

lokiys

Moderator
Регистрация
01.02.2012
Сообщения
4 771
Благодарностей
1 184
Баллы
113

darkdiver

Administrator
Команда форума
Регистрация
13.01.2009
Сообщения
2 284
Благодарностей
2 728
Баллы
113
wrap you code with the
C#:
try
{
// your code   
}
catch(Exception e)
{
    project.SendErrorToLog(e.Message, e.StackTrace);
    throw;
}
reading the stack trace will help you to understand the problematic function.
but ZennoPoster does not include the information about code line of the error. Because this will decrease the execution speed.
 
  • Спасибо
Реакции: lokiys

Кто просматривает тему: (Всего: 1, Пользователи: 0, Гости: 1)