Skip to content

Stop generating filterSensitiveLog and namespaces for service exceptions #3090

@AllanZhengYP

Description

@AllanZhengYP

Is your feature request related to a problem? Please describe.

Currently we generate a namespace and a filterSensitiveLog() for each of the exception shape, for example:

export namespace InvalidParameterException {
/**
* @internal
*/
export const filterSensitiveLog = (obj: InvalidParameterException): any => ({
...obj,
});
}

They are not used because filterSensitiveLog() is only called in loggerMiddleware where exceptions are not logged:

input: inputFilterSensitiveLog(args.input),
output: outputFilterSensitiveLog(outputWithoutMetadata),

Because namespace in TS is not tree-shake-able, these useless functions are left in customers productions code too.

Describe the solution you'd like

Since they are internal APIs and not used anyware, we should remove them. It can reduce in customers' bundling size too.

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature-requestNew feature or enhancement. May require GitHub community feedback.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions