Type: system.stringsplitoptions
stringsplitoptions. Removeemptyentries to omit empty array elements from the array returned; or stringsplitoptions. None to include empty array elements in the array returned. " stringsplitoptions to omit empty array elements from the returned array. Removeemptyentries ; stringsplitoptions to include the empty array element in the returned array. None .
stringsplitoptions. Removeemptyentries to omit empty array elements from the array returned; or stringsplitoptions. None to include empty array elements in the array returned. " > instance:
This method can be used to return $$ characters $$ characters in exception:
#regionGet error message/// <summary> ///Get error message/// </summary> /// <param name= "msg" ></param> /// <returns></returns> Private stringErrMsg (stringmsg) { if(Msg. Contains ("$$")) returnMsg. Split(new[] {"$$"}, Stringsplitoptions.none) [1]; Else returnmsg; } #endregion
When called:
Catch (Exception e) { thrownew gspexception (errmsg (e.message), errorlevel.info); }
The error message is handled by the ErrMsg method Exception e. E is written in database sql
if (V_count=0then raise_application_error (-20001,' $$ The document has been reviewed or executed and is not allowed to save $$'); End if;
This raise_application_error will return a bunch of strings in C # that contain $$ that the document has been audited or executed, and does not allow the $$ string to be saved . Includes various error messages, such as stack information.
But the foreground pop-up error when do not want other error message, just want to put the document has been audited or executed, not allow to save $$ removed as error message pop-up, this time you can intercept the error message.
First, according to the character $$ the error message to the division, the number of groups, and finally, will be divided into three elements of the array , the first is $$ front error message, the second is two $$ middle error message (This is what we want), the third is
The error message after the second $$. So we just get the second one, which is the array [1].
Msg. Split (New[] {"$$"}, Stringsplitoptions.none)[1];
This method can be called when the exception is processed.