Unlock instant, AI-driven research and patent intelligence for your innovation.

Method and device for adding exception handling module for code

An exception handling and code technology, applied in code compilation, program code conversion, electrical digital data processing, etc., can solve problems such as adding exception handling modules, program exceptions, inconsistent code writing specifications, etc., to achieve strong repeatability and improve efficiency Effect

Pending Publication Date: 2022-01-28
CHINA CONSTRUCTION BANK
View PDF0 Cites 0 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

When the web application code runs abnormally, the exception information is thrown in the catch, and the application will continue to execute (but the application logic may be abnormal at this time, because the program is already abnormal)
[0004] At present, when adding an exception handling module to the code, developers need to manually add a try catch exception handling module for each function, which is highly repetitive and inefficient
In addition, a large-scale web application is often completed by multiple developers. Each developer has inconsistent code writing specifications and different execution capabilities when adding try catch exception handling modules to each function, resulting in exception handling modules or exception handling modules in web applications. Yes or no, there is no guarantee that all functions have added exception handling modules

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Method and device for adding exception handling module for code
  • Method and device for adding exception handling module for code
  • Method and device for adding exception handling module for code

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0053] In order to enable those skilled in the art to better understand the solutions of the present invention, the following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only It is an embodiment of a part of the present invention, but not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by persons of ordinary skill in the art without making creative efforts shall fall within the protection scope of the present invention.

[0054] Those skilled in the art should understand that the embodiments of the present invention may be provided as methods, systems, or computer program products. Accordingly, the present invention can take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware ...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

PUM

No PUM Login to View More

Abstract

The embodiment of the invention discloses a method and device for adding an exception handling module for a code. The method comprises the steps of analyzing the code to be added with the exception handling module into an abstract syntax tree; determining a function to be processed in the abstract syntax tree; determining a function name and function position information of a to-be-processed function according to the abstract syntax tree; generating an exception handling module corresponding to the to-be-processed function according to the function body content, the function name and the function position information of the to-be-processed function; and replacing the function body content of the corresponding to-be-processed function in the abstract syntax tree with the exception handling module to obtain a processed abstract syntax tree, and converting the processed abstract syntax tree into the code to obtain the code added with the exception handling module. According to the method and the device, the efficiency of adding the exception handling module for the code is improved.

Description

technical field [0001] The invention relates to the technical field of program development, in particular to a method and device for adding an exception handling module to codes. Background technique [0002] The code of the web application mainly includes three parts, namely html file, css file and JavaScript file. Among them, the robustness of Web engineering applications mainly depends on the robustness of JavaScript code writing. Since the JavaScript language is single-threaded, if an error occurs in the JavaScript code, the subsequent JavaScript code cannot be executed, and finally the web application cannot run normally. [0003] At present, in order to reduce JavaScript running exceptions, you can add an exception handling module. The exception handling module consists of a try catch statement. The try statement contains business logic information, and the catch statement can print exception information. When the web application code runs abnormally, the exception i...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

Application Information

Patent Timeline
no application Login to View More
IPC IPC(8): G06F11/07G06F8/41
CPCG06F11/079G06F11/0772G06F8/42
Inventor 孟繁贵梁锐
Owner CHINA CONSTRUCTION BANK