@onereach/channel-transformer
Version:
Convert data model between different channels (Slack, Microsoft Teams, Generic...)
26 lines (23 loc) • 409 B
text/typescript
interface IErrorObject {
readonly type: 'error',
props: {
message: string
}
}
interface IInputErrorData {
type: string,
message: string
}
export const getErrorObject = ({ type, message }: IInputErrorData) => {
return function () {
return {
type: 'error',
props: {
message: `${message}: No method found for type: ${type}`
}
}
}
}
export {
IErrorObject
}