当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript logger.dbError方法代码示例

本文整理汇总了TypeScript中eta-lib.logger.dbError方法的典型用法代码示例。如果您正苦于以下问题:TypeScript logger.dbError方法的具体用法?TypeScript logger.dbError怎么用?TypeScript logger.dbError使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在eta-lib.logger的用法示例。


在下文中一共展示了logger.dbError方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: CURRENT_TIMESTAMP

 eta.db.query(sql, [req.session["userid"]], (err: eta.DBError, rows: any[]) => {
     if (err) {
         eta.logger.dbError(err);
         res.redirect("/apply?error=" + querystring.escape("We were unable to process your application due to an internal error."));
         return;
     }
     let valueSql: string = "(?, ?, 1),".repeat(positions.length);
     let sql: string = `
         INSERT INTO ApplicantPosition
         (id, position, count)
         VALUES ${valueSql.substring(0, valueSql.length - 1)}
         ON DUPLICATE KEY UPDATE
             lastApplied = CURRENT_TIMESTAMP(),
             count = count + 1`;
     let params: string[] = [];
     for (let i: number = 0; i < positions.length; i++) {
         params.push(req.session["userid"]);
         params.push(positions[i]);
     }
     eta.db.query(sql, params, (err: eta.DBError, rows: any[]) => {
         if (err) {
             eta.logger.dbError(err);
             res.redirect("/apply?error=" + querystring.escape("We were unable to process your application due to an internal error."));
             return;
         }
         res.redirect("/apply?success=true");
     });
 });
开发者ID:crossroads-education,项目名称:eta-front,代码行数:28,代码来源:apply.ts

示例2: callback

 eta.db.query(sql, [req.body.start, req.body.end], (err: eta.DBError, rawDays: any[]) => {
     if (err) {
         eta.logger.dbError(err);
         callback({ errcode: eta.http.InternalError });
         return;
     }
     let days: {
         [date: string]: {
             isExamJam: boolean;
             isClosed: boolean;
         }
     } = {};
     for (let i: number = 0; i < examJamDays.length; i++) {
         rawDays.push(examJamDays[i]);
     }
     for (let i: number = 0; i < rawDays.length; i++) {
         let day: string = eta.time.getStandardDate(rawDays[i].day);
         if (!days[day]) {
             days[day] = {
                 "isExamJam": false,
                 "isClosed": false
             };
         }
         if (rawDays[i].isExamJam) {
             days[day].isExamJam = true;
         }
         if (rawDays[i].isClosed) {
             days[day].isClosed = true;
         }
     }
     callback({
         "raw": JSON.stringify(days)
     });
 });
开发者ID:crossroads-education,项目名称:eta-front,代码行数:34,代码来源:get-calendar.ts

示例3:

 eta.db.query(sql, result.params, (err: eta.DBError, rows: any[]) => {
     if (err) {
         eta.logger.dbError(err);
         return;
     }
     eta.logger.trace("Successfully updated table " + tableName);
 });
开发者ID:crossroads-education,项目名称:eta-sys,代码行数:7,代码来源:update-database.ts

示例4:

 eta.db.query(sql, params, (err: eta.DBError, rows: any[]) => {
     if (err) {
         eta.logger.dbError(err);
         res.redirect("/apply?error=" + querystring.escape("We were unable to process your application due to an internal error."));
         return;
     }
     res.redirect("/apply?success=true");
 });
开发者ID:crossroads-education,项目名称:eta-front,代码行数:8,代码来源:apply.ts

示例5: callback

 eta.db.query(sql, [], (err: eta.DBError, rows: any[]) => {
     if (err) {
         eta.logger.dbError(err);
         callback({ errcode: eta.http.InternalError });
         return;
     }
     eta.logger.trace("Fixed Section.");
     callback({ "status": "Success" });
 });
开发者ID:crossroads-education,项目名称:eta-sys,代码行数:9,代码来源:fix-sections.ts

示例6: callback

 eta.db.query(sql, [], (err: eta.DBError, rows: any[]) => {
     if (err) {
         eta.logger.dbError(err);
         callback({ errcode: eta.http.InternalError });
         return;
     }
     callback({
         "articles": rows
     });
 });
开发者ID:crossroads-education,项目名称:eta-front,代码行数:10,代码来源:press.ts

示例7: callback

 eta.db.query(sql, [req.query.id, req.query.id], (err: eta.DBError, rows: any[]) => {
     if (err) {
         eta.logger.dbError(err);
         callback({ errcode: eta.http.InternalError });
         return;
     }
     callback({
         "section": section,
         "students": rows,
         "isPastWeek": isPastWeek
     });
 });
开发者ID:crossroads-education,项目名称:eta-front,代码行数:12,代码来源:section.ts

示例8: callback

 eta.db.query(sql, params, (err: eta.DBError, rows: any[]) => {
     if (err) {
         eta.logger.dbError(err);
         callback({ errcode: eta.http.InternalError });
         return;
     }
     callback({
         "raw": JSON.stringify({
             "firstName": person.firstName,
             "lastName": person.lastName,
             "visits": rows
         })
     });
 });
开发者ID:crossroads-education,项目名称:eta-front,代码行数:14,代码来源:get-single.ts

示例9: callback

 eta.db.query(sql, [eta.term.getCurrent().id], (err: eta.DBError, rows: any[]) => {
     if (err) {
         eta.logger.dbError(err);
         callback({ errcode: eta.http.InternalError });
         return;
     }
     for (let i: number = 0; i < rows.length; i++) {
         let lastTimeOut: string = rows[i].visitTimesOut.split(", ")[0];
         rows[i].isCurrent = (lastTimeOut === "NULL") && rows[i].visitLastTimeIn;
     }
     callback({
         "students": rows,
         "isPastWeek": isPastWeek
     })
 });
开发者ID:crossroads-education,项目名称:eta-front,代码行数:15,代码来源:athlete.ts

示例10: callback

 eta.db.query(sql, [req.query.from, req.query.to], (err: eta.DBError, closedRows: any[]) => {
     if (err) {
         eta.logger.dbError(err);
         callback({ errcode: eta.http.InternalError });
         return;
     }
     let n: number = 0;
     for (let i: number = 0; i < closedRows.length; i++) {
         closedRows[i].id = n;
         closedRows[i].url = "";
         closedRows[i].class = "event-danger";
         closedRows[i].title = "Closed";
     }
     sql = `
         SELECT
             UNIX_TIMESTAMP(DateExamJam.start) * 1000 AS start,
             UNIX_TIMESTAMP(DateExamJam.end) * 1000 AS end,
             Course.subject AS subject,
             Course.number AS number
         FROM
             DateExamJam
                 LEFT JOIN Course ON
                     DateExamJam.course = Course.id
         WHERE
             UNIX_TIMESTAMP(start) >= ? / 1000 AND
             UNIX_TIMESTAMP(end) < ? / 1000`;
     eta.db.query(sql, [req.query.from, req.query.to], (err: eta.DBError, examJamRows: any[]) => {
         if (err) {
             eta.logger.dbError(err);
             callback({ errcode: eta.http.InternalError });
             return;
         }
         for (let i: number = 0; i < examJamRows.length; i++) {
             examJamRows[i].id = n;
             examJamRows[i].url = "";
             examJamRows[i].class = "event-info";
             examJamRows[i].title = examJamRows[i].subject + " " + examJamRows[i].number + " Exam Jam @ " + eta.time.getMinuteTime(new Date(examJamRows[i].start)).toString();
             closedRows.push(examJamRows[i]);
         }
         callback({
             raw: JSON.stringify({
                 "success": 1,
                 "result": closedRows
             })
         });
     });
 });
开发者ID:crossroads-education,项目名称:eta-front,代码行数:47,代码来源:get-hours.ts


注:本文中的eta-lib.logger.dbError方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。