optimize exception handling
parent
59ee57827b
commit
4feccbd442
|
|
@ -1,2 +1,2 @@
|
|||
TARO_APP_ID="wx636eb7cf2b84f305"
|
||||
TARO_APP_API=""
|
||||
TARO_APP_API="https://ate.zjueva.net"
|
||||
|
|
@ -27,12 +27,12 @@ export function addToOreo(that: TicketDetail) {
|
|||
});
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log(err);
|
||||
console.log(err.errMsg);
|
||||
that.setState({
|
||||
isOreoLoading: false,
|
||||
});
|
||||
Taro.atMessage({
|
||||
message: pt.get().button.submitText.error + err.toString(),
|
||||
message: pt.get().button.submitText.error + err.errMsg.toString(),
|
||||
type: 'error',
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -34,12 +34,12 @@ export function changeDutyCnt(that: MainPage) {
|
|||
}, reLaunchInterval);
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log(err);
|
||||
console.log(err.errMsg);
|
||||
that.setState({
|
||||
isLoading: false,
|
||||
});
|
||||
Taro.atMessage({
|
||||
message: pt.get().button.submitText.error + err.toString(),
|
||||
message: pt.get().button.submitText.error + err.errMsg.toString(),
|
||||
type: 'error',
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -35,12 +35,12 @@ export function changeStatus(that: TicketDetail, status: number) {
|
|||
}, reLaunchInterval);
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log(err);
|
||||
console.log(err.errMsg);
|
||||
that.setState({
|
||||
isStatusLoading: false,
|
||||
});
|
||||
Taro.atMessage({
|
||||
message: pt.get().button.submitText.error + err.toString(),
|
||||
message: pt.get().button.submitText.error + err.errMsg.toString(),
|
||||
type: 'error',
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ export function checkToken(): string {
|
|||
return '';
|
||||
}
|
||||
} catch (err) {
|
||||
console.log(err);
|
||||
console.log(err.errMsg);
|
||||
return '';
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ export function getCurrentTicket(that: RepairPage) {
|
|||
.catch((err) => {
|
||||
console.log(err);
|
||||
Taro.atMessage({
|
||||
message: pt.get().button.submitText.error + err.toString(),
|
||||
message: pt.get().button.submitText.error + err.errMsg.toString(),
|
||||
type: 'error',
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ export function getDutyInfo(that: MainPage) {
|
|||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log(err);
|
||||
console.log(err.errMsg);
|
||||
let former = that.state.rs;
|
||||
that.setState({
|
||||
rs: former.trans(false),
|
||||
|
|
|
|||
|
|
@ -28,6 +28,6 @@ export function getDisable(that: TicketDetail, id: number) {
|
|||
}
|
||||
})
|
||||
.catch((reason) => {
|
||||
console.error(reason);
|
||||
console.log(reason.errMsg);
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -42,6 +42,6 @@ export function getInfo() {
|
|||
getLocaleData();
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log(err);
|
||||
console.log(err.errMsg);
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ export function loginAte() {
|
|||
getLocaleData();
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log(err);
|
||||
console.log(err.errMsg);
|
||||
});
|
||||
} else {
|
||||
console.log('Login Failed: ' + res.errMsg);
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ export function getMemberDutyInfo(that: MainPage) {
|
|||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log(err);
|
||||
console.log(err.errMsg);
|
||||
that.setState({
|
||||
dutyData: {
|
||||
isInDuty: false,
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ export function memberLogin(that: UserMemberPage) {
|
|||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log(err);
|
||||
console.log(err.errMsg);
|
||||
that.setState({
|
||||
isLoading: false,
|
||||
});
|
||||
|
|
@ -90,12 +90,12 @@ export function memberLogout(that: UserMemberPage) {
|
|||
});
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log(err);
|
||||
console.log(err.errMsg);
|
||||
that.setState({
|
||||
isLoading: false,
|
||||
});
|
||||
Taro.atMessage({
|
||||
message: pt.get().button.logoutText.error + err.toString(),
|
||||
message: pt.get().button.logoutText.error + err.errMsg.toString(),
|
||||
type: 'error',
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -47,6 +47,6 @@ export function getMyTicketList(that: MyTicketPage) {
|
|||
that.setState({
|
||||
rs: former.trans(false),
|
||||
});
|
||||
console.log(reason);
|
||||
console.log(reason.errMsg);
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -34,12 +34,12 @@ export function pickTicket(that: TicketDetail) {
|
|||
}, reLaunchInterval);
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log(err);
|
||||
console.log(err.errMsg);
|
||||
that.setState({
|
||||
isPickLoading: false,
|
||||
});
|
||||
Taro.atMessage({
|
||||
message: pt.get().button.submitText.error + err.toString(),
|
||||
message: pt.get().button.submitText.error + err.errMsg.toString(),
|
||||
type: 'error',
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -27,12 +27,12 @@ export function reportMessage(that: ReportPage) {
|
|||
});
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log(err);
|
||||
console.log(err.errMsg);
|
||||
that.setState({
|
||||
isLoading: false,
|
||||
});
|
||||
Taro.atMessage({
|
||||
message: pt.get().button.submitText.error + err.toString(),
|
||||
message: pt.get().button.submitText.error + err.errMsg.toString(),
|
||||
type: 'error',
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -34,12 +34,12 @@ export function retrieve(that: TicketDetail) {
|
|||
}, reLaunchInterval);
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log(err);
|
||||
console.log(err.errMsg);
|
||||
that.setState({
|
||||
isRetrieveLoading: false,
|
||||
});
|
||||
Taro.atMessage({
|
||||
message: pt.get().button.submitText.error + err.toString(),
|
||||
message: pt.get().button.submitText.error + err.errMsg.toString(),
|
||||
type: 'error',
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -34,12 +34,12 @@ export function submitComment(that: TicketDetail) {
|
|||
}, reLaunchInterval);
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log(err);
|
||||
console.log(err.errMsg);
|
||||
that.setState({
|
||||
isCommentLoading: false,
|
||||
});
|
||||
Taro.atMessage({
|
||||
message: pt.get().button.submitText.error + err.toString(),
|
||||
message: pt.get().button.submitText.error + err.errMsg.toString(),
|
||||
type: 'error',
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -69,7 +69,7 @@ export function submitTicket(that: RepairPage) {
|
|||
console.log(re);
|
||||
},
|
||||
fail: function (err) {
|
||||
console.log(err);
|
||||
console.log(err.errMsg);
|
||||
},
|
||||
complete: function () {
|
||||
setTimeout(() => {
|
||||
|
|
@ -82,12 +82,12 @@ export function submitTicket(that: RepairPage) {
|
|||
});
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log(err);
|
||||
console.log(err.errMsg);
|
||||
that.setState({
|
||||
isLoading: false,
|
||||
});
|
||||
Taro.atMessage({
|
||||
message: pt.get().button.submitText.error + err.toString(),
|
||||
message: pt.get().button.submitText.error + err.errMsg.toString(),
|
||||
type: 'error',
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -107,6 +107,6 @@ export function searchTicketList(that: TicketListPage) {
|
|||
that.setState({
|
||||
rs: former.trans(false),
|
||||
});
|
||||
console.log(reason);
|
||||
console.log(reason.errMsg);
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -81,6 +81,6 @@ export function getTicketInfo(that: DetailFramework, id: number) {
|
|||
that.setState({
|
||||
rs: former.trans(false),
|
||||
});
|
||||
console.error(reason);
|
||||
console.error(reason.errMsg);
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -40,6 +40,6 @@ export function getUncompletedTicketList(that: MainPage) {
|
|||
that.setState({
|
||||
rs: former.trans(false),
|
||||
});
|
||||
console.log(reason);
|
||||
console.log(reason.errMsg);
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -28,12 +28,12 @@ export function updateUserInfo(that: InformPage) {
|
|||
});
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log(err);
|
||||
console.log(err.errMsg);
|
||||
that.setState({
|
||||
isLoading: false,
|
||||
});
|
||||
Taro.atMessage({
|
||||
message: pt.get().button.submitText.error + err.toString(),
|
||||
message: pt.get().button.submitText.error + err.errMsg.toString(),
|
||||
type: 'error',
|
||||
});
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in New Issue