core,presets: replace PROCESSING_FAILED to PRESET_FAILED

This commit is contained in:
Micooz 2017-08-30 15:07:06 +08:00
parent 85342b7dd9
commit 0c4aa5aeea
No known key found for this signature in database
GPG Key ID: 002FB5DD584D6CB1
4 changed files with 8 additions and 8 deletions

@ -3,7 +3,7 @@ import {
MIDDLEWARE_DIRECTION_UPWARD,
MIDDLEWARE_DIRECTION_DOWNWARD
} from './middleware';
import {PRESET_INIT, PROCESSING_FAILED} from '../presets/defs';
import {PRESET_INIT, PRESET_FAILED} from '../presets/defs';
export class Pipe extends EventEmitter {
@ -61,7 +61,7 @@ export class Pipe extends EventEmitter {
// methods to be injected
const direct = (buf, isReverse = false) => this.emit(isReverse ? `next_${-direction}` : eventName, buf);
const fail = (name, message) => this.onBroadcast({
type: PROCESSING_FAILED,
type: PRESET_FAILED,
payload: {
name,
message,

@ -14,7 +14,7 @@ import {
CONNECTION_CREATED,
CONNECTION_CLOSED,
SOCKET_CONNECT_TO_REMOTE,
PROCESSING_FAILED
PRESET_FAILED
} from '../presets/defs';
import {BEHAVIOUR_EVENT_ON_PRESET_FAILED} from '../behaviours';
@ -312,7 +312,7 @@ export class Relay extends EventEmitter {
}
break;
}
case PROCESSING_FAILED: {
case PRESET_FAILED: {
const props = {
remoteHost: this._remoteHost,
remotePort: this._remotePort,

@ -46,7 +46,7 @@ export const SOCKET_CONNECT_TO_REMOTE = 'socket/connect/to/remote';
/**
* {
* type: PROCESSING_FAILED,
* type: PRESET_FAILED,
* payload: {
* name: 'custom' or null,
* message: 'explain',
@ -54,7 +54,7 @@ export const SOCKET_CONNECT_TO_REMOTE = 'socket/connect/to/remote';
* }
* }
*/
export const PROCESSING_FAILED = 'processing/failed';
export const PRESET_FAILED = 'preset/failed';
export class IPreset {

@ -1,5 +1,5 @@
import fs from 'fs';
import {IPreset, PROCESSING_FAILED, CONNECTION_CLOSED, CONNECTION_CREATED} from './defs';
import {IPreset, PRESET_FAILED, CONNECTION_CLOSED, CONNECTION_CREATED} from './defs';
const now = () => (new Date()).getTime();
@ -183,7 +183,7 @@ export default class StatsPreset extends IPreset {
}
onNotified(action) {
if (action.type === PROCESSING_FAILED) {
if (action.type === PRESET_FAILED) {
StatsPreset.totalErrors += 1;
}
if (action.type === CONNECTION_CREATED) {